This should always be signed chars, so use int8_t. This fixes a miscompile when

llvm is built with unsigned chars where an immediate such as 0xff would be zero
extended to 64-bits, turning "cmp $0xff,%eax" into
"cmp $0xffffffffffffffff,%eax".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129845 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky 2011-04-20 03:19:42 +00:00
parent 4788c3e839
commit 52a83995d6

View File

@ -482,9 +482,9 @@ def X86_COND_P : PatLeaf<(i8 14)>; // alt. COND_PE
def X86_COND_S : PatLeaf<(i8 15)>;
let FastIselShouldIgnore = 1 in { // FastIsel should ignore all simm8 instrs.
def i16immSExt8 : ImmLeaf<i16, [{ return Imm == (char)Imm; }]>;
def i32immSExt8 : ImmLeaf<i32, [{ return Imm == (char)Imm; }]>;
def i64immSExt8 : ImmLeaf<i64, [{ return Imm == (char)Imm; }]>;
def i16immSExt8 : ImmLeaf<i16, [{ return Imm == (int8_t)Imm; }]>;
def i32immSExt8 : ImmLeaf<i32, [{ return Imm == (int8_t)Imm; }]>;
def i64immSExt8 : ImmLeaf<i64, [{ return Imm == (int8_t)Imm; }]>;
}
def i64immSExt32 : ImmLeaf<i64, [{ return Imm == (int32_t)Imm; }]>;