2017-10-28 14:31:46 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2014-08-20 03:44:13 +08:00
|
|
|
; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=small < %s | FileCheck %s
|
|
|
|
; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=large < %s | FileCheck %s --check-prefix=LARGE
|
2017-10-28 14:31:48 +08:00
|
|
|
; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=small -mattr=avx < %s | FileCheck %s --check-prefix=AVX
|
|
|
|
; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=large -mattr=avx < %s | FileCheck %s --check-prefix=LARGE_AVX
|
2017-10-29 10:18:41 +08:00
|
|
|
; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=small -mattr=avx512f < %s | FileCheck %s --check-prefix=AVX
|
|
|
|
; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=large -mattr=avx512f < %s | FileCheck %s --check-prefix=LARGE_AVX
|
2013-04-11 07:30:20 +08:00
|
|
|
|
2014-08-20 03:44:13 +08:00
|
|
|
; Make sure fast isel uses rip-relative addressing for the small code model.
|
|
|
|
define float @constpool_float(float %x) {
|
2017-10-28 14:31:46 +08:00
|
|
|
; CHECK-LABEL: constpool_float:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2017-10-28 14:31:46 +08:00
|
|
|
; CHECK-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero
|
|
|
|
; CHECK-NEXT: addss %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; LARGE-LABEL: constpool_float:
|
2017-12-05 01:18:51 +08:00
|
|
|
; LARGE: ## %bb.0:
|
2018-06-29 01:56:43 +08:00
|
|
|
; LARGE-NEXT: movabsq $LCPI0_0, %rax
|
2017-10-28 14:31:46 +08:00
|
|
|
; LARGE-NEXT: addss (%rax), %xmm0
|
|
|
|
; LARGE-NEXT: retq
|
2017-10-28 14:31:48 +08:00
|
|
|
;
|
|
|
|
; AVX-LABEL: constpool_float:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX: ## %bb.0:
|
2017-10-28 14:31:48 +08:00
|
|
|
; AVX-NEXT: vmovss {{.*#+}} xmm1 = mem[0],zero,zero,zero
|
|
|
|
; AVX-NEXT: vaddss %xmm1, %xmm0, %xmm0
|
|
|
|
; AVX-NEXT: retq
|
|
|
|
;
|
|
|
|
; LARGE_AVX-LABEL: constpool_float:
|
2017-12-05 01:18:51 +08:00
|
|
|
; LARGE_AVX: ## %bb.0:
|
2018-06-29 01:56:43 +08:00
|
|
|
; LARGE_AVX-NEXT: movabsq $LCPI0_0, %rax
|
2017-10-28 14:31:48 +08:00
|
|
|
; LARGE_AVX-NEXT: vaddss (%rax), %xmm0, %xmm0
|
|
|
|
; LARGE_AVX-NEXT: retq
|
2009-07-02 11:14:25 +08:00
|
|
|
|
2014-08-20 03:44:13 +08:00
|
|
|
%1 = fadd float %x, 16.50e+01
|
|
|
|
ret float %1
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @constpool_double(double %x) nounwind {
|
2017-10-28 14:31:46 +08:00
|
|
|
; CHECK-LABEL: constpool_double:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: ## %bb.0:
|
2017-10-28 14:31:46 +08:00
|
|
|
; CHECK-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; CHECK-NEXT: addsd %xmm1, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; LARGE-LABEL: constpool_double:
|
2017-12-05 01:18:51 +08:00
|
|
|
; LARGE: ## %bb.0:
|
2018-06-29 01:56:43 +08:00
|
|
|
; LARGE-NEXT: movabsq $LCPI1_0, %rax
|
2017-10-28 14:31:46 +08:00
|
|
|
; LARGE-NEXT: addsd (%rax), %xmm0
|
|
|
|
; LARGE-NEXT: retq
|
2017-10-28 14:31:48 +08:00
|
|
|
;
|
|
|
|
; AVX-LABEL: constpool_double:
|
2017-12-05 01:18:51 +08:00
|
|
|
; AVX: ## %bb.0:
|
2017-10-28 14:31:48 +08:00
|
|
|
; AVX-NEXT: vmovsd {{.*#+}} xmm1 = mem[0],zero
|
|
|
|
; AVX-NEXT: vaddsd %xmm1, %xmm0, %xmm0
|
|
|
|
; AVX-NEXT: retq
|
|
|
|
;
|
|
|
|
; LARGE_AVX-LABEL: constpool_double:
|
2017-12-05 01:18:51 +08:00
|
|
|
; LARGE_AVX: ## %bb.0:
|
2018-06-29 01:56:43 +08:00
|
|
|
; LARGE_AVX-NEXT: movabsq $LCPI1_0, %rax
|
2017-10-28 14:31:48 +08:00
|
|
|
; LARGE_AVX-NEXT: vaddsd (%rax), %xmm0, %xmm0
|
|
|
|
; LARGE_AVX-NEXT: retq
|
2014-08-20 03:44:13 +08:00
|
|
|
|
|
|
|
%1 = fadd double %x, 8.500000e-01
|
|
|
|
ret double %1
|
2009-07-02 11:14:25 +08:00
|
|
|
}
|