blob: f2f57413d08a406d576523e223aba24174be77d9 [file] [log] [blame]
// 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
//
// http://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 RiscVFInst32[32] : Inst32Format {
// RiscV32 single precision floating point instructions.
flw : IType : func3 == 0b010, opcode == 0b000'0111;
fsw : SType : func3 == 0b010, opcode == 0b010'0111;
fmadd_s : R4Type : func2 == 0b00, opcode == 0b100'0011;
fmsub_s : R4Type : func2 == 0b00, opcode == 0b100'0111;
fnmsub_s : R4Type : func2 == 0b00, opcode == 0b100'1011;
fnmadd_s : R4Type : func2 == 0b00, opcode == 0b100'1111;
fadd_s : RType : func7 == 0b000'0000, opcode == 0b101'0011;
fsub_s : RType : func7 == 0b000'0100, opcode == 0b101'0011;
fmul_s : RType : func7 == 0b000'1000, opcode == 0b101'0011;
fdiv_s : RType : func7 == 0b000'1100, opcode == 0b101'0011;
fsqrt_s : RType : func7 == 0b010'1100, rs2 == 0, opcode == 0b101'0011;
fsgnj_s : RType : func7 == 0b001'0000, func3 == 0b000, opcode == 0b101'0011;
fsgnjn_s : RType : func7 == 0b001'0000, func3 == 0b001, opcode == 0b101'0011;
fsgnjx_s : RType : func7 == 0b001'0000, func3 == 0b010, opcode == 0b101'0011;
fmin_s : RType : func7 == 0b001'0100, func3 == 0b000, opcode == 0b101'0011;
fmax_s : RType : func7 == 0b001'0100, func3 == 0b001, opcode == 0b101'0011;
fcvt_ws : RType : func7 == 0b110'0000, rs2 == 0, opcode == 0b101'0011;
fcvt_wus : RType : func7 == 0b110'0000, rs2 == 1, opcode == 0b101'0011;
fmv_xw : RType : func7 == 0b111'0000, rs2 == 0, func3 == 0b000, opcode == 0b101'0011;
fcmpeq_s : RType : func7 == 0b101'0000, func3 == 0b010, opcode == 0b101'0011;
fcmplt_s : RType : func7 == 0b101'0000, func3 == 0b001, opcode == 0b101'0011;
fcmple_s : RType : func7 == 0b101'0000, func3 == 0b000, opcode == 0b101'0011;
fclass_s : RType : func7 == 0b111'0000, rs2 == 0, func3 == 0b001, opcode == 0b101'0011;
fcvt_sw : RType : func7 == 0b110'1000, rs2 == 0, opcode == 0b101'0011;
fcvt_swu : RType : func7 == 0b110'1000, rs2 == 1, opcode == 0b101'0011;
fmv_wx : RType : func7 == 0b111'1000, rs2 == 0, func3 == 0b000, opcode == 0b101'0011;
};