diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoD.td b/llvm/lib/Target/RISCV/RISCVInstrInfoD.td index aeb9ebc56a975e..59312f02aeceb7 100644 --- a/llvm/lib/Target/RISCV/RISCVInstrInfoD.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoD.td @@ -397,12 +397,12 @@ foreach Ext = DExts in { // Match non-signaling FEQ_D foreach Ext = DExts in { - defm : PatSetCC_m; - defm : PatSetCC_m; - defm : PatSetCC_m; - defm : PatSetCC_m; - defm : PatSetCC_m; - defm : PatSetCC_m; + defm : PatSetCC_m; + defm : PatSetCC_m; + defm : PatSetCC_m; + defm : PatSetCC_m; + defm : PatSetCC_m; + defm : PatSetCC_m; } let Predicates = [HasStdExtD] in { diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoF.td b/llvm/lib/Target/RISCV/RISCVInstrInfoF.td index 6ff6e4e5f3a723..8726245f1602eb 100644 --- a/llvm/lib/Target/RISCV/RISCVInstrInfoF.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoF.td @@ -481,10 +481,10 @@ class PatSetCC : Pat<(XLenVT (OpNode (vt Ty:$rs1), Ty:$rs2, Cond)), (Inst $rs1, $rs2)>; multiclass PatSetCC_m { + RVInst Inst, ExtInfo Ext> { let Predicates = Ext.Predicates in def Ext.Suffix : PatSetCC(Inst#Ext.Suffix), vt>; + !cast(Inst#Ext.Suffix), Ext.PrimaryVT>; } class PatFprFpr; - defm : PatSetCC_m; - defm : PatSetCC_m; - defm : PatSetCC_m; - defm : PatSetCC_m; - defm : PatSetCC_m; + defm : PatSetCC_m; + defm : PatSetCC_m; + defm : PatSetCC_m; + defm : PatSetCC_m; + defm : PatSetCC_m; + defm : PatSetCC_m; } let Predicates = [HasStdExtF] in { @@ -645,10 +645,10 @@ def : Pat<(XLenVT (strict_fsetccs FPR32INX:$rs1, FPR32INX:$rs1, SETOEQ)), } // Predicates = [HasStdExtZfinx] foreach Ext = FExts in { - defm : PatSetCC_m; - defm : PatSetCC_m; - defm : PatSetCC_m; - defm : PatSetCC_m; + defm : PatSetCC_m; + defm : PatSetCC_m; + defm : PatSetCC_m; + defm : PatSetCC_m; } let Predicates = [HasStdExtF] in { diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoZfh.td b/llvm/lib/Target/RISCV/RISCVInstrInfoZfh.td index c53462a74f3626..b65e9f5af03319 100644 --- a/llvm/lib/Target/RISCV/RISCVInstrInfoZfh.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoZfh.td @@ -248,7 +248,6 @@ def PseudoQuietFLT_H_INX : PseudoQuietFCMP; // Pseudo-instructions and codegen patterns //===----------------------------------------------------------------------===// -let Predicates = [HasStdExtZfh] in { /// Float conversion operations @@ -257,11 +256,14 @@ let Predicates = [HasStdExtZfh] in { /// Float arithmetic operations -def : PatFprFprDynFrm; -def : PatFprFprDynFrm; -def : PatFprFprDynFrm; -def : PatFprFprDynFrm; +foreach Ext = ZfhExts in { + defm : PatFprFprDynFrm_m; + defm : PatFprFprDynFrm_m; + defm : PatFprFprDynFrm_m; + defm : PatFprFprDynFrm_m; +} +let Predicates = [HasStdExtZfh] in { def : Pat<(f16 (any_fsqrt FPR16:$rs1)), (FSQRT_H FPR16:$rs1, FRM_DYN)>; def : Pat<(f16 (fneg FPR16:$rs1)), (FSGNJN_H $rs1, $rs1)>; @@ -304,11 +306,6 @@ let Predicates = [HasStdExtZhinx] in { /// Float arithmetic operations -def : PatFprFprDynFrm; -def : PatFprFprDynFrm; -def : PatFprFprDynFrm; -def : PatFprFprDynFrm; - def : Pat<(any_fsqrt FPR16INX:$rs1), (FSQRT_H_INX FPR16INX:$rs1, FRM_DYN)>; def : Pat<(fneg FPR16INX:$rs1), (FSGNJN_H_INX $rs1, $rs1)>; @@ -358,12 +355,12 @@ foreach Ext = ZfhExts in { // Match non-signaling FEQ_D foreach Ext = ZfhExts in { - defm : PatSetCC_m; - defm : PatSetCC_m; - defm : PatSetCC_m; - defm : PatSetCC_m; - defm : PatSetCC_m; - defm : PatSetCC_m; + defm : PatSetCC_m; + defm : PatSetCC_m; + defm : PatSetCC_m; + defm : PatSetCC_m; + defm : PatSetCC_m; + defm : PatSetCC_m; } let Predicates = [HasStdExtZfh] in { @@ -397,10 +394,10 @@ def : Pat<(XLenVT (strict_fsetccs FPR16INX:$rs1, FPR16INX:$rs1, SETOEQ)), } // Predicates = [HasStdExtZhinx] foreach Ext = ZfhExts in { - defm : PatSetCC_m; - defm : PatSetCC_m; - defm : PatSetCC_m; - defm : PatSetCC_m; + defm : PatSetCC_m; + defm : PatSetCC_m; + defm : PatSetCC_m; + defm : PatSetCC_m; } let Predicates = [HasStdExtZfh] in {