diff options
author | Chad Rosier <mcrosier@apple.com> | 2011-11-04 23:09:49 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2011-11-04 23:09:49 +0000 |
commit | e8b8b7730721eb3eb5f4ebe7dba104e011f59a06 (patch) | |
tree | b819f1f7fea02ae7ccc5a1faebc3a5703fd712ae /llvm/lib/Target/ARM/ARMFastISel.cpp | |
parent | 21079cad11b8fc0906b59e8ac4f6d46233cedbf8 (diff) | |
download | bcm5719-llvm-e8b8b7730721eb3eb5f4ebe7dba104e011f59a06.tar.gz bcm5719-llvm-e8b8b7730721eb3eb5f4ebe7dba104e011f59a06.zip |
When materializing an i32, SExt vs ZExt doesn't matter when we're trying to fit
in a 16-bit immediate. However, for the shorter non-legal types (i.e., i1, i8,
i16) we should not sign-extend. This prevents us from materializing things
such as 'true' (i.e., i1 1).
llvm-svn: 143743
Diffstat (limited to 'llvm/lib/Target/ARM/ARMFastISel.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMFastISel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMFastISel.cpp b/llvm/lib/Target/ARM/ARMFastISel.cpp index e8e8124b662..a315c305fca 100644 --- a/llvm/lib/Target/ARM/ARMFastISel.cpp +++ b/llvm/lib/Target/ARM/ARMFastISel.cpp @@ -551,7 +551,7 @@ unsigned ARMFastISel::ARMMaterializeInt(const Constant *C, EVT VT) { // If we can do this in a single instruction without a constant pool entry // do so now. const ConstantInt *CI = cast<ConstantInt>(C); - if (Subtarget->hasV6T2Ops() && isUInt<16>(CI->getSExtValue())) { + if (Subtarget->hasV6T2Ops() && isUInt<16>(CI->getZExtValue())) { unsigned Opc = isThumb ? ARM::t2MOVi16 : ARM::MOVi16; unsigned ImmReg = createResultReg(TLI.getRegClassFor(VT)); AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, |