diff options
author | Chris Lattner <sabre@nondot.org> | 2007-07-16 05:43:05 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-07-16 05:43:05 +0000 |
commit | 99e0d7905d1576ac85bb6f969a2d969c4d2e7f82 (patch) | |
tree | ae2e410c174b02e47bed22f43d26492d714de229 /CodeGen/CodeGenFunction.cpp | |
parent | 1467e03df1dce515ed3013c7dcb6f5c541ab0d5f (diff) |
Add a hack (mirroring llvm-gcc) to pointer difference
codegen to compile:
int test(int *A, int *B) {
return A-B;
}
into:
_test:
movl 4(%esp), %eax
subl 8(%esp), %eax
sarl $2, %eax
ret
instead of:
_test:
movl 4(%esp), %eax
subl 8(%esp), %eax
movl %eax, %ecx
sarl $31, %ecx
shrl $30, %ecx
addl %ecx, %eax
sarl $2, %eax
ret
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39902 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions