1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=small < %s | FileCheck %s
3 ; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=large < %s | FileCheck %s --check-prefix=LARGE
4 ; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=small -mattr=avx < %s | FileCheck %s --check-prefix=AVX
5 ; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=large -mattr=avx < %s | FileCheck %s --check-prefix=LARGE_AVX
6 ; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=small -mattr=avx512f < %s | FileCheck %s --check-prefix=AVX
7 ; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=large -mattr=avx512f < %s | FileCheck %s --check-prefix=LARGE_AVX
9 ; Make sure fast isel uses rip-relative addressing for the small code model.
10 define float @constpool_float(float %x) {
11 ; CHECK-LABEL: constpool_float:
13 ; CHECK-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero
14 ; CHECK-NEXT: addss %xmm1, %xmm0
17 ; LARGE-LABEL: constpool_float:
19 ; LARGE-NEXT: movabsq $LCPI0_0, %rax
20 ; LARGE-NEXT: addss (%rax), %xmm0
23 ; AVX-LABEL: constpool_float:
25 ; AVX-NEXT: vmovss {{.*#+}} xmm1 = mem[0],zero,zero,zero
26 ; AVX-NEXT: vaddss %xmm1, %xmm0, %xmm0
29 ; LARGE_AVX-LABEL: constpool_float:
30 ; LARGE_AVX: ## %bb.0:
31 ; LARGE_AVX-NEXT: movabsq $LCPI0_0, %rax
32 ; LARGE_AVX-NEXT: vaddss (%rax), %xmm0, %xmm0
33 ; LARGE_AVX-NEXT: retq
35 %1 = fadd float %x, 16.50e+01
39 define double @constpool_double(double %x) nounwind {
40 ; CHECK-LABEL: constpool_double:
42 ; CHECK-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
43 ; CHECK-NEXT: addsd %xmm1, %xmm0
46 ; LARGE-LABEL: constpool_double:
48 ; LARGE-NEXT: movabsq $LCPI1_0, %rax
49 ; LARGE-NEXT: addsd (%rax), %xmm0
52 ; AVX-LABEL: constpool_double:
54 ; AVX-NEXT: vmovsd {{.*#+}} xmm1 = mem[0],zero
55 ; AVX-NEXT: vaddsd %xmm1, %xmm0, %xmm0
58 ; LARGE_AVX-LABEL: constpool_double:
59 ; LARGE_AVX: ## %bb.0:
60 ; LARGE_AVX-NEXT: movabsq $LCPI1_0, %rax
61 ; LARGE_AVX-NEXT: vaddsd (%rax), %xmm0, %xmm0
62 ; LARGE_AVX-NEXT: retq
64 %1 = fadd double %x, 8.500000e-01