summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-02-27 01:17:20 +0000
committerChris Lattner <sabre@nondot.org>2008-02-27 01:17:20 +0000
commit3f86109fd1ed9ea215f1ab2be9453f0a059f8306 (patch)
treea563aee26926bfb0bff5eade1eb5211348c18d9a /llvm/lib
parent947528f00027c8d7550cf8922bf2f2be900a6a57 (diff)
downloadbcm5719-llvm-3f86109fd1ed9ea215f1ab2be9453f0a059f8306.tar.gz
bcm5719-llvm-3f86109fd1ed9ea215f1ab2be9453f0a059f8306.zip
add a note
llvm-svn: 47652
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/README-X86-64.txt27
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/README-X86-64.txt b/llvm/lib/Target/X86/README-X86-64.txt
index bc19986eba4..bdff56d40bf 100644
--- a/llvm/lib/Target/X86/README-X86-64.txt
+++ b/llvm/lib/Target/X86/README-X86-64.txt
@@ -234,3 +234,30 @@ down by 8 and truncate it. It's not pretty but it works. We need some register
allocation magic to make the hack go away (e.g. putting additional constraints
on the result of the movb).
+//===---------------------------------------------------------------------===//
+
+This function:
+double a(double b) {return (unsigned)b;}
+compiles to this code:
+
+_a:
+ subq $8, %rsp
+ cvttsd2siq %xmm0, %rax
+ movl $4294967295, %ecx
+ andq %rcx, %rax
+ cvtsi2sdq %rax, %xmm0
+ addq $8, %rsp
+ ret
+
+note the dead rsp adjustments. Also, there is surely a better/shorter way
+to clear the top 32-bits of a 64-bit register than movl+andq. Testcase here:
+
+unsigned long long c(unsigned long long a) {return a&4294967295; }
+
+_c:
+ movl $4294967295, %ecx
+ movq %rdi, %rax
+ andq %rcx, %rax
+ ret
+
+//===---------------------------------------------------------------------===//
OpenPOWER on IntegriCloud