aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
authorShih-wei Liao <sliao@google.com>2011-06-15 12:38:29 -0700
committerShih-wei Liao <sliao@google.com>2011-06-15 12:38:29 -0700
commitb460d4ba2d88c13480c2a6a8495de9d07a2c9f66 (patch)
treed23c75f9822883e4e67805ca729ba339f13b2ffa /lib/Target
parentca65f4e8b7d5566d70a99273a4baabf4dbf08c05 (diff)
downloadexternal_llvm-b460d4ba2d88c13480c2a6a8495de9d07a2c9f66.zip
external_llvm-b460d4ba2d88c13480c2a6a8495de9d07a2c9f66.tar.gz
external_llvm-b460d4ba2d88c13480c2a6a8495de9d07a2c9f66.tar.bz2
Fix the wrong encoding of vmov.32's immed8 value in LLVM's ARMInstrVFP.td.
Taking Renderscript Balls as example, fc: eeb00a03 vmov.f32 s0, #3 120: edd00a02 vldr s1, [r0, #8] 128: ee600a80 vmul.f32 s1, s1, s0 VFPexpand in ARM's hardware will expand #3 above to 0x4e180000. This corresponds to floating point value of 2.375. However, in the original Balls code it is 6.0. As a result, Balls got smaller recently. Note that 6.0 in F32 is 0x40c00000 and 6.0 in F64 is 0x4018000000000000! This leads to how I fixed the bug. Change-Id: I9a8e71771884dc27d5b9392abe7dfa541b45f357
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/ARM/ARMInstrVFP.td6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Target/ARM/ARMInstrVFP.td b/lib/Target/ARM/ARMInstrVFP.td
index 840b880..a731731 100644
--- a/lib/Target/ARM/ARMInstrVFP.td
+++ b/lib/Target/ARM/ARMInstrVFP.td
@@ -1077,9 +1077,9 @@ def FCONSTS : VFPAI<(outs SPR:$Sd), (ins vfp_f32imm:$imm),
// Encode instruction operands.
let Inst{15-12} = Sd{4-1};
let Inst{22} = Sd{0};
- let Inst{19} = imm{31};
- let Inst{18-16} = imm{25-23};
- let Inst{3-0} = imm{22-19};
+ let Inst{19} = imm{31}; // The immediate is handled as a double.
+ let Inst{18-16} = imm{22-20};
+ let Inst{3-0} = imm{19-16};
// Encode remaining instruction bits.
let Inst{27-23} = 0b11101;