Mercurial > hg > CbC > CbC_llvm
comparison test/CodeGen/X86/uint64-to-float.ll @ 120:1172e4bd9c6f
update 4.0.0
author | mir3636 |
---|---|
date | Fri, 25 Nov 2016 19:14:25 +0900 |
parents | afa8332a0e37 |
children | 803732b1fca8 |
comparison
equal
deleted
inserted
replaced
101:34baf5011add | 120:1172e4bd9c6f |
---|---|
1 ; RUN: llc < %s -mcpu=generic -march=x86-64 | FileCheck %s | 1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py |
2 ; RUN: llc < %s -mtriple=i686-apple-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X86 | |
3 ; RUN: llc < %s -mtriple=x86_64-apple-unknown -mattr=+sse2 | FileCheck %s --check-prefix=X64 | |
4 | |
2 ; Verify that we are using the efficient uitofp --> sitofp lowering illustrated | 5 ; Verify that we are using the efficient uitofp --> sitofp lowering illustrated |
3 ; by the compiler_rt implementation of __floatundisf. | 6 ; by the compiler_rt implementation of __floatundisf. |
4 ; <rdar://problem/8493982> | 7 ; <rdar://problem/8493982> |
5 | 8 |
6 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" | 9 define float @test(i64 %a) nounwind { |
7 target triple = "x86_64-apple-darwin10.0.0" | 10 ; X86-LABEL: test: |
8 | 11 ; X86: # BB#0: # %entry |
9 ; CHECK: andl | 12 ; X86-NEXT: pushl %ebp |
10 ; CHECK-NEXT: testq %rdi, %rdi | 13 ; X86-NEXT: movl %esp, %ebp |
11 ; CHECK-NEXT: js LBB0_1 | 14 ; X86-NEXT: andl $-8, %esp |
12 ; CHECK: cvtsi2ss | 15 ; X86-NEXT: subl $16, %esp |
13 ; CHECK-NEXT: ret | 16 ; X86-NEXT: movq {{.*#+}} xmm0 = mem[0],zero |
14 ; CHECK: LBB0_1 | 17 ; X86-NEXT: movq %xmm0, {{[0-9]+}}(%esp) |
15 ; CHECK: shrq | 18 ; X86-NEXT: xorl %eax, %eax |
16 ; CHECK-NEXT: orq | 19 ; X86-NEXT: cmpl $0, 12(%ebp) |
17 ; CHECK-NEXT: cvtsi2ss | 20 ; X86-NEXT: setns %al |
18 define float @test(i64 %a) { | 21 ; X86-NEXT: fildll {{[0-9]+}}(%esp) |
22 ; X86-NEXT: fadds {{\.LCPI.*}}(,%eax,4) | |
23 ; X86-NEXT: fstps {{[0-9]+}}(%esp) | |
24 ; X86-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero | |
25 ; X86-NEXT: movss %xmm0, (%esp) | |
26 ; X86-NEXT: flds (%esp) | |
27 ; X86-NEXT: movl %ebp, %esp | |
28 ; X86-NEXT: popl %ebp | |
29 ; X86-NEXT: retl | |
30 ; | |
31 ; X64-LABEL: test: | |
32 ; X64: # BB#0: # %entry | |
33 ; X64-NEXT: testq %rdi, %rdi | |
34 ; X64-NEXT: js .LBB0_1 | |
35 ; X64-NEXT: # BB#2: # %entry | |
36 ; X64-NEXT: cvtsi2ssq %rdi, %xmm0 | |
37 ; X64-NEXT: retq | |
38 ; X64-NEXT: .LBB0_1: | |
39 ; X64-NEXT: movq %rdi, %rax | |
40 ; X64-NEXT: shrq %rax | |
41 ; X64-NEXT: andl $1, %edi | |
42 ; X64-NEXT: orq %rax, %rdi | |
43 ; X64-NEXT: cvtsi2ssq %rdi, %xmm0 | |
44 ; X64-NEXT: addss %xmm0, %xmm0 | |
45 ; X64-NEXT: retq | |
19 entry: | 46 entry: |
20 %b = uitofp i64 %a to float | 47 %b = uitofp i64 %a to float |
21 ret float %b | 48 ret float %b |
22 } | 49 } |