diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-10-08 18:28:28 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-10-08 18:28:28 +0000 |
commit | ed744827041a97336461abdc91b43fd0eafb869c (patch) | |
tree | c0afdff591d94ef9b85d826b8b241fc4c16b19bc /lib/Target/X86/X86InstrArithmetic.td | |
parent | a55f6575aede9a47ce95b4d195eae72e989cde19 (diff) | |
download | llvm-ed744827041a97336461abdc91b43fd0eafb869c.tar.gz llvm-ed744827041a97336461abdc91b43fd0eafb869c.tar.bz2 llvm-ed744827041a97336461abdc91b43fd0eafb869c.tar.xz |
Add TEST8ri_NOREX pseudo to constrain sub_8bit_hi copies.
In 64-bit mode, sub_8bit_hi sub-registers can only be used by NOREX
instructions. The COPY created from the EXTRACT_SUBREG DAG node cannot
target all GR8 registers, only those in GR8_NOREX.
TO enforce this, we ensure that all instructions using the
EXTRACT_SUBREG are GR8_NOREX constrained.
This fixes PR11088.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141499 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86InstrArithmetic.td')
-rw-r--r-- | lib/Target/X86/X86InstrArithmetic.td | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Target/X86/X86InstrArithmetic.td b/lib/Target/X86/X86InstrArithmetic.td index 6d2c53495c..f6ed722c07 100644 --- a/lib/Target/X86/X86InstrArithmetic.td +++ b/lib/Target/X86/X86InstrArithmetic.td @@ -1145,5 +1145,11 @@ let Defs = [EFLAGS] in { "{$src, %eax|EAX, $src}">; def TEST64i32 : BinOpAI<0xA8, "test", Xi64, RAX, "{$src, %rax|RAX, $src}">; + + // When testing the result of EXTRACT_SUBREG sub_8bit_hi, make sure the + // register class is constrained to GR8_NOREX. + let isPseudo = 1 in + def TEST8ri_NOREX : I<0, Pseudo, (outs), (ins GR8_NOREX:$src, i8imm:$mask), + "", []>; } |