diff options
author | Chris Lattner <sabre@nondot.org> | 2010-10-07 00:43:39 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-10-07 00:43:39 +0000 |
commit | be5f266e8ec0ba34dd0ed05123f8e8d7c0b02713 (patch) | |
tree | bc3d054451b4ce6daac3299f259aca8d528cc55a /lib | |
parent | 5492a1d971627bede4f228880a18aaae5d8c75f7 (diff) | |
download | external_llvm-be5f266e8ec0ba34dd0ed05123f8e8d7c0b02713.zip external_llvm-be5f266e8ec0ba34dd0ed05123f8e8d7c0b02713.tar.gz external_llvm-be5f266e8ec0ba34dd0ed05123f8e8d7c0b02713.tar.bz2 |
add a new BinOpAI class to represent the immediate form that directly acts on EAX.
This does change the generated .inc files to include the implicit use/def of eax.
Since these instructions are only generated by the assembler and disassembler it
doesn't actually matter though.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115885 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/X86/X86InstrArithmetic.td | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/lib/Target/X86/X86InstrArithmetic.td b/lib/Target/X86/X86InstrArithmetic.td index e131538..9d76295 100644 --- a/lib/Target/X86/X86InstrArithmetic.td +++ b/lib/Target/X86/X86InstrArithmetic.td @@ -686,6 +686,17 @@ class BinOpMI8<bits<8> opcode, string mnemonic, X86TypeInfo typeinfo, let ImmT = Imm8; // Always 8-bit immediate. } +// BinOpAI - Instructions like "add %eax, %eax, imm". +class BinOpAI<bits<8> opcode, string mnemonic, X86TypeInfo typeinfo, + Register areg> + : ITy<opcode, RawFrm, typeinfo, + (outs), (ins typeinfo.ImmOperand:$src), + mnemonic, !strconcat("{$src, %", areg.AsmName, "|%", + areg.AsmName, ", $src}"), []> { + let ImmT = typeinfo.ImmEncoding; + let Uses = [areg]; + let Defs = [areg]; +} // Logical operators. let Defs = [EFLAGS] in { @@ -737,17 +748,12 @@ def AND64mi32 : BinOpMI<0x80, "and", Xi64, and, MRM4m>; def AND16mi8 : BinOpMI8<0x82, "and", Xi16, and, MRM4m>; def AND32mi8 : BinOpMI8<0x82, "and", Xi32, and, MRM4m>; def AND64mi8 : BinOpMI8<0x82, "and", Xi64, and, MRM4m>; - -// FIXME: Implicitly modifies AL. -def AND8i8 : Ii8<0x24, RawFrm, (outs), (ins i8imm:$src), - "and{b}\t{$src, %al|%al, $src}", []>; -def AND16i16 : Ii16<0x25, RawFrm, (outs), (ins i16imm:$src), - "and{w}\t{$src, %ax|%ax, $src}", []>, OpSize; -def AND32i32 : Ii32<0x25, RawFrm, (outs), (ins i32imm:$src), - "and{l}\t{$src, %eax|%eax, $src}", []>; -def AND64i32 : RIi32<0x25, RawFrm, (outs), (ins i64i32imm:$src), - "and{q}\t{$src, %rax|%rax, $src}", []>; +def AND8i8 : BinOpAI<0x24, "and", Xi8 , AL>; +def AND16i16 : BinOpAI<0x24, "and", Xi16, AX>; +def AND32i32 : BinOpAI<0x24, "and", Xi32, EAX>; +def AND64i32 : BinOpAI<0x24, "and", Xi64, RAX>; + let Constraints = "$src1 = $dst" in { |