blob: 9dcc64a2d54feb386b48566b6f94825ad1e15826 [file] [edit]
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This file defines the cache block zero instruction in the Zicboz extension.
//
// The cache block size zeroed by `cbo.zero` is implementation-specific. It is
// bound to the semantic function here as 64 bytes, the common cache line size
// across RISC-V profiles. ISAs for implementations with a different cache block
// size can override `cbo_zero` and bind their own size.
slot riscv_zicboz32 {
includes {
#include "absl/functional/bind_front.h"
#include "riscv/riscv_zicboz_instructions.h"
}
default size = 4;
opcodes {
cbo_zero{: rs1 :},
resources: { rs1 :},
disasm: "cbo.zero", "0(%rs1)",
semfunc: "absl::bind_front(&RV32::RiscVCboZero, /*cache_block_size=*/64)";
}
}
slot riscv_zicboz64 : riscv_zicboz32 {
includes {
#include "absl/functional/bind_front.h"
#include "riscv/riscv_zicboz_instructions.h"
}
default size = 4;
opcodes {
cbo_zero = override,
semfunc: "absl::bind_front(&RV64::RiscVCboZero, /*cache_block_size=*/64)";
}
}