1 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 -fast-isel | FileCheck %s --check-prefix=ALL --check-prefix=SSE
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx -fast-isel | FileCheck %s --check-prefix=ALL --check-prefix=AVX
4 ; Verify that fast-isel doesn't select legacy SSE instructions on targets that
7 ; Test cases are obtained from the following code snippet:
9 ; double single_to_double_rr(float x) {
12 ; float double_to_single_rr(double x) {
15 ; double single_to_double_rm(float *x) {
18 ; float double_to_single_rm(double *x) {
23 define double @single_to_double_rr(float %x) {
24 ; ALL-LABEL: single_to_double_rr:
26 ; AVX: vcvtss2sd %xmm0, %xmm0, %xmm0
29 %conv = fpext float %x to double
33 define float @double_to_single_rr(double %x) {
34 ; ALL-LABEL: double_to_single_rr:
36 ; AVX: vcvtsd2ss %xmm0, %xmm0, %xmm0
39 %conv = fptrunc double %x to float
43 define double @single_to_double_rm(float* %x) {
44 ; ALL-LABEL: single_to_double_rm:
45 ; SSE: cvtss2sd (%rdi), %xmm0
46 ; AVX: vmovss (%rdi), %xmm0
47 ; AVX-NEXT: vcvtss2sd %xmm0, %xmm0, %xmm0
50 %0 = load float* %x, align 4
51 %conv = fpext float %0 to double
55 define float @double_to_single_rm(double* %x) {
56 ; ALL-LABEL: double_to_single_rm:
57 ; SSE: cvtsd2ss (%rdi), %xmm0
58 ; AVX: vmovsd (%rdi), %xmm0
59 ; AVX-NEXT: vcvtsd2ss %xmm0, %xmm0, %xmm0
62 %0 = load double* %x, align 8
63 %conv = fptrunc double %0 to float