diff --git a/llvm/lib/Target/X86/X86InstrArithmetic.td b/llvm/lib/Target/X86/X86InstrArithmetic.td --- a/llvm/lib/Target/X86/X86InstrArithmetic.td +++ b/llvm/lib/Target/X86/X86InstrArithmetic.td @@ -281,9 +281,9 @@ WriteALU.ReadAfterFold]>; // reg // BinOpMR_RMW_FF - Binary instructions with inputs "[mem], reg", where the -// pattern use EFLAGS as operand and implicitly use EFLAGS. +// pattern sets EFLAGS and implicitly uses EFLAGS. class BinOpMR_RMW_FF opcode, string mnemonic, X86TypeInfo typeinfo, - SDNode opnode> + SDNode opnode> : BinOpMR; // BinOpMI_RMW_FF - Binary instructions with inputs "[mem], imm", where the -// pattern use EFLAGS as operand and implicitly use EFLAGS. +// pattern sets EFLAGS and implicitly uses EFLAGS. class BinOpMI_RMW_FF opcode, string mnemonic, X86TypeInfo typeinfo, SDNode opnode, Format f> : BinOpMI; // BinOpMI8_RMW_FF - Binary instructions with inputs "[mem], imm8", where the -// pattern use EFLAGS as operand and implicitly use EFLAGS. +// pattern sets EFLAGS and implicitly uses EFLAGS. class BinOpMI8_RMW_FF : BinOpMI8 : UnaryOpR<0xFE, f, mnemonic, info, - [(set info.RegClass:$dst, EFLAGS, - (node info.RegClass:$src1, 1))]>; + [(set info.RegClass:$dst, EFLAGS, + (node info.RegClass:$src1, 1))]>; // INCDECM - Instructions like "inc [mem]". class INCDECM @@ -459,8 +459,8 @@ // NegOpR - Instructions like "neg reg", with implicit EFLAGS. class NegOpR opcode, string mnemonic, X86TypeInfo info> : UnaryOpR; + [(set info.RegClass:$dst, (ineg info.RegClass:$src1)), + (implicit EFLAGS)]>; // NotOpR - Instructions like "not reg". class NotOpR opcode, string mnemonic, X86TypeInfo info> @@ -516,12 +516,11 @@ class IMulOpRRI8 opcode, string mnemonic, X86TypeInfo info, X86FoldableSchedWrite sched> : ITy, + (ins info.RegClass:$src1, info.Imm8Operand:$src2), mnemonic, + "{$src2, $src1, $dst|$dst, $src1, $src2}", + [(set info.RegClass:$dst, EFLAGS, + (X86smul_flag info.RegClass:$src1, + info.Imm8NoSuOperator:$src2))]>, Sched<[sched]>{ let ImmT = Imm8; } @@ -530,12 +529,11 @@ class IMulOpRRI opcode, string mnemonic, X86TypeInfo info, X86FoldableSchedWrite sched> : ITy, + (ins info.RegClass:$src1, info.ImmOperand:$src2), mnemonic, + "{$src2, $src1, $dst|$dst, $src1, $src2}", + [(set info.RegClass:$dst, EFLAGS, + (X86smul_flag info.RegClass:$src1, + info.ImmNoSuOperator:$src2))]>, Sched<[sched]>{ let ImmT = info.ImmEncoding; } @@ -544,12 +542,11 @@ class IMulOpRMI8 opcode, string mnemonic, X86TypeInfo info, X86FoldableSchedWrite sched> : ITy, + (ins info.MemOperand:$src1, info.Imm8Operand:$src2), mnemonic, + "{$src2, $src1, $dst|$dst, $src1, $src2}", + [(set info.RegClass:$dst, EFLAGS, + (X86smul_flag (info.LoadNode addr:$src1), + info.Imm8NoSuOperator:$src2))]>, Sched<[sched.Folded]>{ let ImmT = Imm8; } @@ -558,12 +555,11 @@ class IMulOpRMI opcode, string mnemonic, X86TypeInfo info, X86FoldableSchedWrite sched> : ITy, + (ins info.MemOperand:$src1, info.ImmOperand:$src2), mnemonic, + "{$src2, $src1, $dst|$dst, $src1, $src2}", + [(set info.RegClass:$dst, EFLAGS, + (X86smul_flag (info.LoadNode addr:$src1), + info.ImmNoSuOperator:$src2))]>, Sched<[sched.Folded]>{ let ImmT = info.ImmEncoding; }