Andrea Di Biagio | df93ccf | 2015-03-04 14:23:25 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=x86_64-unknown-unknown -mcpu=generic -mattr=+sse2 -fast-isel --fast-isel-abort=1 < %s | FileCheck %s --check-prefix=ALL --check-prefix=SSE2 |
| 2 | ; RUN: llc -mtriple=x86_64-unknown-unknown -mcpu=generic -mattr=+avx -fast-isel --fast-isel-abort=1 < %s | FileCheck %s --check-prefix=ALL --check-prefix=AVX |
Andrea Di Biagio | e7b58ee | 2015-02-17 23:40:58 +0000 | [diff] [blame] | 3 | |
| 4 | |
| 5 | define double @int_to_double_rr(i32 %a) { |
| 6 | ; ALL-LABEL: int_to_double_rr: |
| 7 | ; SSE2: cvtsi2sdl %edi, %xmm0 |
| 8 | ; AVX: vcvtsi2sdl %edi, %xmm0, %xmm0 |
| 9 | ; ALL-NEXT: ret |
| 10 | entry: |
| 11 | %0 = sitofp i32 %a to double |
| 12 | ret double %0 |
| 13 | } |
| 14 | |
| 15 | define double @int_to_double_rm(i32* %a) { |
| 16 | ; ALL-LABEL: int_to_double_rm: |
| 17 | ; SSE2: cvtsi2sdl (%rdi), %xmm0 |
| 18 | ; AVX: vcvtsi2sdl (%rdi), %xmm0, %xmm0 |
| 19 | ; ALL-NEXT: ret |
| 20 | entry: |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 21 | %0 = load i32, i32* %a |
Andrea Di Biagio | e7b58ee | 2015-02-17 23:40:58 +0000 | [diff] [blame] | 22 | %1 = sitofp i32 %0 to double |
| 23 | ret double %1 |
| 24 | } |
| 25 | |
| 26 | define float @int_to_float_rr(i32 %a) { |
| 27 | ; ALL-LABEL: int_to_float_rr: |
| 28 | ; SSE2: cvtsi2ssl %edi, %xmm0 |
| 29 | ; AVX: vcvtsi2ssl %edi, %xmm0, %xmm0 |
| 30 | ; ALL-NEXT: ret |
| 31 | entry: |
| 32 | %0 = sitofp i32 %a to float |
| 33 | ret float %0 |
| 34 | } |
| 35 | |
| 36 | define float @int_to_float_rm(i32* %a) { |
| 37 | ; ALL-LABEL: int_to_float_rm: |
| 38 | ; SSE2: cvtsi2ssl (%rdi), %xmm0 |
| 39 | ; AVX: vcvtsi2ssl (%rdi), %xmm0, %xmm0 |
| 40 | ; ALL-NEXT: ret |
| 41 | entry: |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 42 | %0 = load i32, i32* %a |
Andrea Di Biagio | e7b58ee | 2015-02-17 23:40:58 +0000 | [diff] [blame] | 43 | %1 = sitofp i32 %0 to float |
| 44 | ret float %1 |
| 45 | } |