summaryrefslogtreecommitdiff
path: root/lib/Bytecode
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-04-25 21:20:28 +0000
committerChris Lattner <sabre@nondot.org>2005-04-25 21:20:28 +0000
commit229ab2e7b24847ea0d248d3d8b3d83adc8e5f5fe (patch)
tree7578223095354db1dbf74c3e572350ada4d9ab4e /lib/Bytecode
parent6cc0311c6d013ac5d7602be87ccd4c48b9d8fafc (diff)
downloadllvm-229ab2e7b24847ea0d248d3d8b3d83adc8e5f5fe.tar.gz
llvm-229ab2e7b24847ea0d248d3d8b3d83adc8e5f5fe.tar.bz2
llvm-229ab2e7b24847ea0d248d3d8b3d83adc8e5f5fe.tar.xz
implement some more logical compares with constants, so that:
int foo1(int x, int y) { int t1 = x >= 0; int t2 = y >= 0; return t1 & t2; } int foo2(int x, int y) { int t1 = x == -1; int t2 = y == -1; return t1 & t2; } produces: _foo1: or r2, r4, r3 srwi r2, r2, 31 xori r3, r2, 1 blr _foo2: and r2, r4, r3 addic r2, r2, 1 li r2, 0 addze r3, r2 blr instead of: _foo1: srwi r2, r4, 31 xori r2, r2, 1 srwi r3, r3, 31 xori r3, r3, 1 and r3, r2, r3 blr _foo2: addic r2, r4, 1 li r2, 0 addze r2, r2 addic r3, r3, 1 li r3, 0 addze r3, r3 and r3, r2, r3 blr git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21547 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode')
0 files changed, 0 insertions, 0 deletions