xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/fast-isel-constpool.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=small < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=large < %s | FileCheck %s --check-prefix=LARGE
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; Make sure fast isel uses rip-relative addressing for the small code model.
5*9880d681SAndroid Build Coastguard Workerdefine float @constpool_float(float %x) {
6*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: constpool_float
7*9880d681SAndroid Build Coastguard Worker; CHECK:       LCPI0_0(%rip)
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Worker; LARGE-LABEL: constpool_float
10*9880d681SAndroid Build Coastguard Worker; LARGE:       movabsq  $LCPI0_0, %rax
11*9880d681SAndroid Build Coastguard Worker  %1 = fadd float %x, 16.50e+01
12*9880d681SAndroid Build Coastguard Worker  ret float %1
13*9880d681SAndroid Build Coastguard Worker}
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Workerdefine double @constpool_double(double %x) nounwind {
16*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: constpool_double
17*9880d681SAndroid Build Coastguard Worker; CHECK:       LCPI1_0(%rip)
18*9880d681SAndroid Build Coastguard Worker
19*9880d681SAndroid Build Coastguard Worker; LARGE-LABEL: constpool_double
20*9880d681SAndroid Build Coastguard Worker; LARGE:       movabsq  $LCPI1_0, %rax
21*9880d681SAndroid Build Coastguard Worker  %1 = fadd double %x, 8.500000e-01
22*9880d681SAndroid Build Coastguard Worker  ret double %1
23*9880d681SAndroid Build Coastguard Worker}
24