1
1
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2
2
; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=small < %s | FileCheck %s
3
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
4
6
5
7
; Make sure fast isel uses rip-relative addressing for the small code model.
6
8
define float @constpool_float (float %x ) {
@@ -15,6 +17,18 @@ define float @constpool_float(float %x) {
15
17
; LARGE-NEXT: movabsq $LCPI0_0, %rax
16
18
; LARGE-NEXT: addss (%rax), %xmm0
17
19
; LARGE-NEXT: retq
20
+ ;
21
+ ; AVX-LABEL: constpool_float:
22
+ ; AVX: ## BB#0:
23
+ ; AVX-NEXT: vmovss {{.*#+}} xmm1 = mem[0],zero,zero,zero
24
+ ; AVX-NEXT: vaddss %xmm1, %xmm0, %xmm0
25
+ ; AVX-NEXT: retq
26
+ ;
27
+ ; LARGE_AVX-LABEL: constpool_float:
28
+ ; LARGE_AVX: ## BB#0:
29
+ ; LARGE_AVX-NEXT: movabsq $LCPI0_0, %rax
30
+ ; LARGE_AVX-NEXT: vaddss (%rax), %xmm0, %xmm0
31
+ ; LARGE_AVX-NEXT: retq
18
32
19
33
%1 = fadd float %x , 16 .50e+01
20
34
ret float %1
@@ -32,6 +46,18 @@ define double @constpool_double(double %x) nounwind {
32
46
; LARGE-NEXT: movabsq $LCPI1_0, %rax
33
47
; LARGE-NEXT: addsd (%rax), %xmm0
34
48
; LARGE-NEXT: retq
49
+ ;
50
+ ; AVX-LABEL: constpool_double:
51
+ ; AVX: ## BB#0:
52
+ ; AVX-NEXT: vmovsd {{.*#+}} xmm1 = mem[0],zero
53
+ ; AVX-NEXT: vaddsd %xmm1, %xmm0, %xmm0
54
+ ; AVX-NEXT: retq
55
+ ;
56
+ ; LARGE_AVX-LABEL: constpool_double:
57
+ ; LARGE_AVX: ## BB#0:
58
+ ; LARGE_AVX-NEXT: movabsq $LCPI1_0, %rax
59
+ ; LARGE_AVX-NEXT: vaddsd (%rax), %xmm0, %xmm0
60
+ ; LARGE_AVX-NEXT: retq
35
61
36
62
%1 = fadd double %x , 8.500000e-01
37
63
ret double %1
0 commit comments