diff options
author | Chris Lattner <sabre@nondot.org> | 2008-01-18 16:54:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-01-18 16:54:56 +0000 |
commit | df7a4ae623ea07eab341bd837d049de15c11a59a (patch) | |
tree | 2e6d1f71fb242e2179dd11ae9efee9371a4309b0 /test/CodeGen/PowerPC | |
parent | c3d7cfa1c02780989b971cc9c0433d54030f8070 (diff) | |
download | external_llvm-df7a4ae623ea07eab341bd837d049de15c11a59a.zip external_llvm-df7a4ae623ea07eab341bd837d049de15c11a59a.tar.gz external_llvm-df7a4ae623ea07eab341bd837d049de15c11a59a.tar.bz2 |
Fix a latent bug exposed by my truncstore patch. We compiled stfiwx-2.ll to:
_test:
fctiwz f0, f1
stfiwx f0, 0, r4
blr
instead of:
_test:
fctiwz f0, f1
stfd f0, -8(r1)
nop
nop
lwz r2, -4(r1)
stb r2, 0(r4)
blr
The former is not correct (stores 4 bytes, not 1).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46161 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/PowerPC')
-rw-r--r-- | test/CodeGen/PowerPC/stfiwx-2.ll | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/stfiwx-2.ll b/test/CodeGen/PowerPC/stfiwx-2.ll new file mode 100644 index 0000000..5c4a834 --- /dev/null +++ b/test/CodeGen/PowerPC/stfiwx-2.ll @@ -0,0 +1,11 @@ +; This cannot be a stfiwx +; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | grep stb +; RUN: llvm-as < %s | llc -march=ppc32 -mcpu=g5 | not grep stfiwx + +define void @test(float %F, i8* %P) { + %I = fptosi float %F to i32 + %X = trunc i32 %I to i8 + store i8 %X, i8* %P + ret void +} + |