| // Copyright 2024 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. |
| |
| instruction group RiscVZbaInst32[32] : Inst32Format { |
| sh1add: RType : func7 == 0b001'0000, func3 == 0b010, opcode == 0b011'0011; |
| sh2add: RType : func7 == 0b001'0000, func3 == 0b100, opcode == 0b011'0011; |
| sh3add: RType : func7 == 0b001'0000, func3 == 0b110, opcode == 0b011'0011; |
| }; |
| |
| instruction group RiscVZbbInst32[32] : Inst32Format { |
| andn: RType : func7 == 0b010'0000, func3 == 0b111, opcode == 0b011'0011; |
| orn: RType : func7 == 0b010'0000, func3 == 0b110, opcode == 0b011'0011; |
| xnor: RType : func7 == 0b010'0000, func3 == 0b100, opcode == 0b011'0011; |
| clz: RType : func7 == 0b011'0000, rs2 == 0b0'0000, func3 == 0b001, opcode == 0b001'0011; |
| ctz: RType : func7 == 0b011'0000, rs2 == 0b0'0001, func3 == 0b001, opcode == 0b001'0011; |
| cpop: RType : func7 == 0b011'0000, rs2 == 0b0'0010, func3 == 0b001, opcode == 0b001'0011; |
| max: RType : func7 == 0b000'0101, func3 == 0b110, opcode == 0b011'0011; |
| maxu: RType : func7 == 0b000'0101, func3 == 0b111, opcode == 0b011'0011; |
| min: RType : func7 == 0b000'0101, func3 == 0b100, opcode == 0b011'0011; |
| minu: RType : func7 == 0b000'0101, func3 == 0b101, opcode == 0b011'0011; |
| sext_b: RType : func7 == 0b011'0000, rs2 == 0b0'0100, func3 == 0b001, opcode == 0b001'0011; |
| sext_h: RType : func7 == 0b011'0000, rs2 == 0b0'0101, func3 == 0b001, opcode == 0b001'0011; |
| rol: RType : func7 == 0b011'0000, func3 == 0b001, opcode == 0b011'0011; |
| ror: RType : func7 == 0b011'0000, func3 == 0b101, opcode == 0b011'0011; |
| orcb: RType : func7 == 0b001'0100, rs2 == 0b0'0111, func3 == 0b101, opcode == 0b001'0011; |
| rev8: RType : func7 == 0b011'0100, rs2 == 0b1'1000, func3 == 0b101, opcode == 0b001'0011; |
| }; |
| |
| instruction group RiscVZbbInst32Only[32] : Inst32Format { |
| zext_h: RType : func7 == 0b000'0100, rs2 == 0b0'0000, func3 == 0b100, opcode == 0b011'0011; |
| } |
| |
| instruction group RiscVZbbImmInst32[32] : Inst32Format { |
| rori: RType : func7 == 0b011'0000, func3 == 0b101, opcode == 0b001'0011; |
| } |
| |
| instruction group RiscVZbcInst32[32] : Inst32Format { |
| clmul: RType : func7 == 0b000'0101, func3 == 0b001, opcode == 0b011'0011; |
| clmulh: RType : func7 == 0b000'0101, func3 == 0b011, opcode == 0b011'0011; |
| clmulr: RType : func7 == 0b000'0101, func3 == 0b010, opcode == 0b011'0011; |
| }; |
| |
| instruction group RiscVZbsInst32[32] : Inst32Format { |
| bclr: RType : func7 == 0b010'0100, func3 == 0b001, opcode == 0b011'0011; |
| bext: RType : func7 == 0b010'0100, func3 == 0b101, opcode == 0b011'0011; |
| binv: RType : func7 == 0b011'0100, func3 == 0b001, opcode == 0b011'0011; |
| bset: RType : func7 == 0b001'0100, func3 == 0b001, opcode == 0b011'0011; |
| }; |
| |
| instruction group RiscVZbsImmInst32[32] : Inst32Format { |
| bclri: RType : func7 == 0b010'0100, func3 == 0b001, opcode == 0b001'0011; |
| bexti: RType : func7 == 0b010'0100, func3 == 0b101, opcode == 0b001'0011; |
| binvi: RType : func7 == 0b011'0100, func3 == 0b001, opcode == 0b001'0011; |
| bseti: RType : func7 == 0b001'0100, func3 == 0b001, opcode == 0b001'0011; |
| }; |