|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py |
| 2 | +; RUN: llc < %s -mtriple=i686-unknown-unknown -fast-isel=0 -global-isel=0 | FileCheck %s --check-prefixes X86,FASTSDAG-X86,SDAG-X86 |
| 3 | +; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 -fast-isel=0 -global-isel=0 | FileCheck %s --check-prefixes SSE,FASTSDAG-SSE,SDAG-SSE |
| 4 | +; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx -fast-isel=0 -global-isel=0 | FileCheck %s --check-prefixes AVX,FASTSDAG-AVX,SDAG-AVX |
| 5 | +; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f -fast-isel=0 -global-isel=0 | FileCheck %s --check-prefixes AVX,FASTSDAG-AVX,SDAG-AVX |
| 6 | +; COMM: FastISel has troubles with fp80 type |
| 7 | +; RUN: llc < %s -mtriple=i686-unknown-unknown -fast-isel=1 -global-isel=0 -fast-isel-abort=0 | FileCheck %s --check-prefixes X86,FASTSDAG-X86,FAST-X86 |
| 8 | +; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 -fast-isel=1 -global-isel=0 -fast-isel-abort=0 | FileCheck %s --check-prefixes SSE,FASTSDAG-SSE,FAST-SSE |
| 9 | +; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx -fast-isel=1 -global-isel=0 -fast-isel-abort=0 | FileCheck %s --check-prefixes AVX,FASTSDAG-AVX,FAST-AVX |
| 10 | +; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f -fast-isel=1 -global-isel=0 -fast-isel-abort=0 | FileCheck %s --check-prefixes AVX,FASTSDAG-AVX,FAST-AVX |
| 11 | +; RUN: llc < %s -mtriple=i686-unknown-unknown -fast-isel=0 -global-isel=1 -global-isel-abort=2 | FileCheck %s --check-prefixes X86,GLOBAL-X86 |
| 12 | +; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 -fast-isel=0 -global-isel=1 -global-isel-abort=2 | FileCheck %s --check-prefixes SSE,GLOBAL-SSE |
| 13 | +; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx -fast-isel=0 -global-isel=1 -global-isel-abort=2 | FileCheck %s --check-prefixes AVX,GLOBAL-AVX |
| 14 | +; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f -fast-isel=0 -global-isel=1 -global-isel-abort=2 | FileCheck %s --check-prefixes AVX,GLOBAL-AVX |
| 15 | + |
| 16 | +define double @fpext_float_to_double(float %f) { |
| 17 | +; X86-LABEL: fpext_float_to_double: |
| 18 | +; X86: # %bb.0: |
| 19 | +; X86-NEXT: flds {{[0-9]+}}(%esp) |
| 20 | +; X86-NEXT: retl |
| 21 | +; |
| 22 | +; SSE-LABEL: fpext_float_to_double: |
| 23 | +; SSE: # %bb.0: |
| 24 | +; SSE-NEXT: cvtss2sd %xmm0, %xmm0 |
| 25 | +; SSE-NEXT: retq |
| 26 | +; |
| 27 | +; AVX-LABEL: fpext_float_to_double: |
| 28 | +; AVX: # %bb.0: |
| 29 | +; AVX-NEXT: vcvtss2sd %xmm0, %xmm0, %xmm0 |
| 30 | +; AVX-NEXT: retq |
| 31 | + %1 = fpext float %f to double |
| 32 | + ret double %1 |
| 33 | +} |
| 34 | + |
| 35 | +define x86_fp80 @fpext_float_to_x86_fp80(float %f) { |
| 36 | +; X86-LABEL: fpext_float_to_x86_fp80: |
| 37 | +; X86: # %bb.0: |
| 38 | +; X86-NEXT: flds {{[0-9]+}}(%esp) |
| 39 | +; X86-NEXT: retl |
| 40 | +; |
| 41 | +; SSE-LABEL: fpext_float_to_x86_fp80: |
| 42 | +; SSE: # %bb.0: |
| 43 | +; SSE-NEXT: movss %xmm0, -{{[0-9]+}}(%rsp) |
| 44 | +; SSE-NEXT: flds -{{[0-9]+}}(%rsp) |
| 45 | +; SSE-NEXT: retq |
| 46 | +; |
| 47 | +; AVX-LABEL: fpext_float_to_x86_fp80: |
| 48 | +; AVX: # %bb.0: |
| 49 | +; AVX-NEXT: vmovss %xmm0, -{{[0-9]+}}(%rsp) |
| 50 | +; AVX-NEXT: flds -{{[0-9]+}}(%rsp) |
| 51 | +; AVX-NEXT: retq |
| 52 | + %1 = fpext float %f to x86_fp80 |
| 53 | + ret x86_fp80 %1 |
| 54 | +} |
| 55 | + |
| 56 | +define x86_fp80 @fpext_double_to_x86_fp80(double %d) { |
| 57 | +; X86-LABEL: fpext_double_to_x86_fp80: |
| 58 | +; X86: # %bb.0: |
| 59 | +; X86-NEXT: fldl {{[0-9]+}}(%esp) |
| 60 | +; X86-NEXT: retl |
| 61 | +; |
| 62 | +; SSE-LABEL: fpext_double_to_x86_fp80: |
| 63 | +; SSE: # %bb.0: |
| 64 | +; SSE-NEXT: movsd %xmm0, -{{[0-9]+}}(%rsp) |
| 65 | +; SSE-NEXT: fldl -{{[0-9]+}}(%rsp) |
| 66 | +; SSE-NEXT: retq |
| 67 | +; |
| 68 | +; AVX-LABEL: fpext_double_to_x86_fp80: |
| 69 | +; AVX: # %bb.0: |
| 70 | +; AVX-NEXT: vmovsd %xmm0, -{{[0-9]+}}(%rsp) |
| 71 | +; AVX-NEXT: fldl -{{[0-9]+}}(%rsp) |
| 72 | +; AVX-NEXT: retq |
| 73 | + %1 = fpext double %d to x86_fp80 |
| 74 | + ret x86_fp80 %1 |
| 75 | +} |
| 76 | + |
| 77 | +define float @fptrunc_double_to_float(double %d) { |
| 78 | +; X86-LABEL: fptrunc_double_to_float: |
| 79 | +; X86: # %bb.0: |
| 80 | +; X86-NEXT: pushl %eax |
| 81 | +; X86-NEXT: .cfi_def_cfa_offset 8 |
| 82 | +; X86-NEXT: fldl {{[0-9]+}}(%esp) |
| 83 | +; X86-NEXT: fstps (%esp) |
| 84 | +; X86-NEXT: flds (%esp) |
| 85 | +; X86-NEXT: popl %eax |
| 86 | +; X86-NEXT: .cfi_def_cfa_offset 4 |
| 87 | +; X86-NEXT: retl |
| 88 | +; |
| 89 | +; SSE-LABEL: fptrunc_double_to_float: |
| 90 | +; SSE: # %bb.0: |
| 91 | +; SSE-NEXT: cvtsd2ss %xmm0, %xmm0 |
| 92 | +; SSE-NEXT: retq |
| 93 | +; |
| 94 | +; AVX-LABEL: fptrunc_double_to_float: |
| 95 | +; AVX: # %bb.0: |
| 96 | +; AVX-NEXT: vcvtsd2ss %xmm0, %xmm0, %xmm0 |
| 97 | +; AVX-NEXT: retq |
| 98 | + %1 = fptrunc double %d to float |
| 99 | + ret float %1 |
| 100 | +} |
| 101 | + |
| 102 | +define float @fptrunc_x86_fp80_to_float(x86_fp80 %x) { |
| 103 | +; X86-LABEL: fptrunc_x86_fp80_to_float: |
| 104 | +; X86: # %bb.0: |
| 105 | +; X86-NEXT: pushl %eax |
| 106 | +; X86-NEXT: .cfi_def_cfa_offset 8 |
| 107 | +; X86-NEXT: fldt {{[0-9]+}}(%esp) |
| 108 | +; X86-NEXT: fstps (%esp) |
| 109 | +; X86-NEXT: flds (%esp) |
| 110 | +; X86-NEXT: popl %eax |
| 111 | +; X86-NEXT: .cfi_def_cfa_offset 4 |
| 112 | +; X86-NEXT: retl |
| 113 | +; |
| 114 | +; SSE-LABEL: fptrunc_x86_fp80_to_float: |
| 115 | +; SSE: # %bb.0: |
| 116 | +; SSE-NEXT: fldt {{[0-9]+}}(%rsp) |
| 117 | +; SSE-NEXT: fstps -{{[0-9]+}}(%rsp) |
| 118 | +; SSE-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero |
| 119 | +; SSE-NEXT: retq |
| 120 | +; |
| 121 | +; AVX-LABEL: fptrunc_x86_fp80_to_float: |
| 122 | +; AVX: # %bb.0: |
| 123 | +; AVX-NEXT: fldt {{[0-9]+}}(%rsp) |
| 124 | +; AVX-NEXT: fstps -{{[0-9]+}}(%rsp) |
| 125 | +; AVX-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero |
| 126 | +; AVX-NEXT: retq |
| 127 | + %1 = fptrunc x86_fp80 %x to float |
| 128 | + ret float %1 |
| 129 | +} |
| 130 | + |
| 131 | +define double @fptrunc_x86_fp80_to_double(x86_fp80 %x) { |
| 132 | +; X86-LABEL: fptrunc_x86_fp80_to_double: |
| 133 | +; X86: # %bb.0: |
| 134 | +; X86-NEXT: pushl %ebp |
| 135 | +; X86-NEXT: .cfi_def_cfa_offset 8 |
| 136 | +; X86-NEXT: .cfi_offset %ebp, -8 |
| 137 | +; X86-NEXT: movl %esp, %ebp |
| 138 | +; X86-NEXT: .cfi_def_cfa_register %ebp |
| 139 | +; X86-NEXT: andl $-8, %esp |
| 140 | +; X86-NEXT: subl $8, %esp |
| 141 | +; X86-NEXT: fldt 8(%ebp) |
| 142 | +; X86-NEXT: fstpl (%esp) |
| 143 | +; X86-NEXT: fldl (%esp) |
| 144 | +; X86-NEXT: movl %ebp, %esp |
| 145 | +; X86-NEXT: popl %ebp |
| 146 | +; X86-NEXT: .cfi_def_cfa %esp, 4 |
| 147 | +; X86-NEXT: retl |
| 148 | +; |
| 149 | +; SSE-LABEL: fptrunc_x86_fp80_to_double: |
| 150 | +; SSE: # %bb.0: |
| 151 | +; SSE-NEXT: fldt {{[0-9]+}}(%rsp) |
| 152 | +; SSE-NEXT: fstpl -{{[0-9]+}}(%rsp) |
| 153 | +; SSE-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero |
| 154 | +; SSE-NEXT: retq |
| 155 | +; |
| 156 | +; AVX-LABEL: fptrunc_x86_fp80_to_double: |
| 157 | +; AVX: # %bb.0: |
| 158 | +; AVX-NEXT: fldt {{[0-9]+}}(%rsp) |
| 159 | +; AVX-NEXT: fstpl -{{[0-9]+}}(%rsp) |
| 160 | +; AVX-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero |
| 161 | +; AVX-NEXT: retq |
| 162 | + %1 = fptrunc x86_fp80 %x to double |
| 163 | + ret double %1 |
| 164 | +} |
| 165 | +;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: |
| 166 | +; FAST-AVX: {{.*}} |
| 167 | +; FAST-SSE: {{.*}} |
| 168 | +; FAST-X86: {{.*}} |
| 169 | +; FASTSDAG-AVX: {{.*}} |
| 170 | +; FASTSDAG-SSE: {{.*}} |
| 171 | +; FASTSDAG-X86: {{.*}} |
| 172 | +; GLOBAL-AVX: {{.*}} |
| 173 | +; GLOBAL-SSE: {{.*}} |
| 174 | +; GLOBAL-X86: {{.*}} |
| 175 | +; SDAG-AVX: {{.*}} |
| 176 | +; SDAG-SSE: {{.*}} |
| 177 | +; SDAG-X86: {{.*}} |
0 commit comments