diff options
author | Nate Begeman <natebegeman@mac.com> | 2005-08-14 01:20:53 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2005-08-14 01:20:53 +0000 |
commit | d2558e3e4af2930730e2314868afd09ba005e282 (patch) | |
tree | 701d8f8b2b34c67486afc523b74ab4124422292f /lib/Target/PowerPC/PPCISelPattern.cpp | |
parent | 5a01481585387a9af267c7cc824b0aaedf665838 (diff) |
Teach the legalizer how to legalize FP_TO_UINT.
Teach the legalizer to promote FP_TO_UINT to FP_TO_SINT if the wider
FP_TO_UINT is also illegal. This allows us on PPC to codegen
unsigned short foo(float a) { return a; }
as:
_foo:
.LBB_foo_0: ; entry
fctiwz f0, f1
stfd f0, -8(r1)
lwz r2, -4(r1)
rlwinm r3, r2, 0, 16, 31
blr
instead of:
_foo:
.LBB_foo_0: ; entry
fctiwz f0, f1
stfd f0, -8(r1)
lwz r2, -4(r1)
lis r3, ha16(.CPI_foo_0)
lfs f0, lo16(.CPI_foo_0)(r3)
fcmpu cr0, f1, f0
blt .LBB_foo_2 ; entry
.LBB_foo_1: ; entry
fsubs f0, f1, f0
fctiwz f0, f0
stfd f0, -16(r1)
lwz r2, -12(r1)
xoris r2, r2, 32768
.LBB_foo_2: ; entry
rlwinm r3, r2, 0, 16, 31
blr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22785 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCISelPattern.cpp')
0 files changed, 0 insertions, 0 deletions