@@ -139,6 +139,16 @@ class RVPUnary_ri<bits<2> w, bits<5> uf, string opcodestr>
139139 let Inst{24-20} = uf;
140140}
141141
142+ let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in
143+ class RVPBinaryScalar_rr<bits<3> f, bits<2> w, bits<3> funct3, string opcodestr>
144+ : RVInstRBase<funct3, OPC_OP_IMM_32, (outs GPR:$rd),
145+ (ins GPR:$rs1, GPR:$rs2), opcodestr, "$rd, $rs1, $rs2"> {
146+ let Inst{31} = 0b1;
147+ let Inst{30-28} = f;
148+ let Inst{27} = 0b1;
149+ let Inst{26-25} = w;
150+ }
151+
142152//===----------------------------------------------------------------------===//
143153// Instructions
144154//===----------------------------------------------------------------------===//
@@ -198,6 +208,34 @@ def PLUI_H : PLUI_i<0b1111000, "plui.h">;
198208let Predicates = [HasStdExtP, IsRV64] in
199209def PLUI_W : PLUI_i<0b1111001, "plui.w">;
200210
211+ let Predicates = [HasStdExtP] in {
212+ def PSLL_HS : RVPBinaryScalar_rr<0b000, 0b00, 0b010, "psll.hs">;
213+ def PSLL_BS : RVPBinaryScalar_rr<0b000, 0b10, 0b010, "psll.bs">;
214+
215+ def PADD_HS : RVPBinaryScalar_rr<0b001, 0b00, 0b010, "padd.hs">;
216+ def PADD_BS : RVPBinaryScalar_rr<0b001, 0b10, 0b010, "padd.bs">;
217+
218+ def PSSHA_HS : RVPBinaryScalar_rr<0b110, 0b00, 0b010, "pssha.hs">;
219+
220+ def PSSHAR_HS : RVPBinaryScalar_rr<0b111, 0b00, 0b010, "psshar.hs">;
221+ } // Predicates = [HasStdExtP]
222+ let Predicates = [HasStdExtP, IsRV32], DecoderNamespace = "RV32Only" in {
223+ def SSHA : RVPBinaryScalar_rr<0b110, 0b01, 0b010, "ssha">;
224+
225+ def SSHAR : RVPBinaryScalar_rr<0b111, 0b01, 0b010, "sshar">;
226+ } // Predicates = [HasStdExtP, IsRV32]
227+ let Predicates = [HasStdExtP, IsRV64] in {
228+ def PSLL_WS : RVPBinaryScalar_rr<0b000, 0b01, 0b010, "psll.ws">;
229+
230+ def PADD_WS : RVPBinaryScalar_rr<0b001, 0b01, 0b010, "padd.ws">;
231+
232+ def PSSHA_WS : RVPBinaryScalar_rr<0b110, 0b01, 0b010, "pssha.ws">;
233+ def SHA : RVPBinaryScalar_rr<0b110, 0b11, 0b010, "sha">;
234+
235+ def PSSHAR_WS : RVPBinaryScalar_rr<0b111, 0b01, 0b010, "psshar.ws">;
236+ def SHAR : RVPBinaryScalar_rr<0b111, 0b11, 0b010, "shar">;
237+ } // Predicates = [HasStdExtP, IsRV64]
238+
201239let Predicates = [HasStdExtP] in {
202240 def PSRLI_B : RVPShiftB_ri<0b000, 0b100, "psrli.b">;
203241 def PSRLI_H : RVPShiftH_ri<0b000, 0b100, "psrli.h">;
@@ -231,3 +269,26 @@ let Predicates = [HasStdExtP, IsRV64] in {
231269 def PSATI_W : RVPShiftW_ri<0b110, 0b100, "psati.w">;
232270 def SATI_RV64 : RVPShiftD_ri<0b110, 0b100, "sati">;
233271} // Predicates = [HasStdExtP, IsRV64]
272+
273+ let Predicates = [HasStdExtP] in {
274+ def PSRL_HS : RVPBinaryScalar_rr<0b000, 0b00, 0b100, "psrl.hs">;
275+ def PSRL_BS : RVPBinaryScalar_rr<0b000, 0b10, 0b100, "psrl.bs">;
276+
277+ def PREDSUM_HS : RVPBinaryScalar_rr<0b001, 0b00, 0b100, "predsum.hs">;
278+ def PREDSUM_BS : RVPBinaryScalar_rr<0b001, 0b10, 0b100, "predsum.bs">;
279+
280+ def PREDSUMU_HS : RVPBinaryScalar_rr<0b011, 0b00, 0b100, "predsumu.hs">;
281+ def PREDSUMU_BS : RVPBinaryScalar_rr<0b011, 0b10, 0b100, "predsumu.bs">;
282+
283+ def PSRA_HS : RVPBinaryScalar_rr<0b100, 0b00, 0b100, "psra.hs">;
284+ def PSRA_BS : RVPBinaryScalar_rr<0b100, 0b10, 0b100, "psra.bs">;
285+ } // Predicates = [HasStdExtP]
286+ let Predicates = [HasStdExtP, IsRV64] in {
287+ def PSRL_WS : RVPBinaryScalar_rr<0b000, 0b01, 0b100, "psrl.ws">;
288+
289+ def PREDSUM_WS : RVPBinaryScalar_rr<0b001, 0b01, 0b100, "predsum.ws">;
290+
291+ def PREDSUMU_WS : RVPBinaryScalar_rr<0b011, 0b01, 0b100, "predsumu.ws">;
292+
293+ def PSRA_WS : RVPBinaryScalar_rr<0b100, 0b01, 0b100, "psra.ws">;
294+ } // Predicates = [HasStdExtP, IsRV64]
0 commit comments