xref: /aosp_15_r20/external/llvm/test/CodeGen/AArch64/fp128-folding.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=aarch64-linux-gnu -verify-machineinstrs -o - %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Workerdeclare void @bar(i8*, i8*, i32*)
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; SelectionDAG used to try to fold some fp128 operations using the ppc128 type,
5*9880d681SAndroid Build Coastguard Worker; which is not supported.
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Workerdefine fp128 @test_folding() {
8*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test_folding:
9*9880d681SAndroid Build Coastguard Worker  %l = alloca i32
10*9880d681SAndroid Build Coastguard Worker  store i32 42, i32* %l
11*9880d681SAndroid Build Coastguard Worker  %val = load i32, i32* %l
12*9880d681SAndroid Build Coastguard Worker  %fpval = sitofp i32 %val to fp128
13*9880d681SAndroid Build Coastguard Worker  ; If the value is loaded from a constant pool into an fp128, it's been folded
14*9880d681SAndroid Build Coastguard Worker  ; successfully.
15*9880d681SAndroid Build Coastguard Worker; CHECK: ldr {{q[0-9]+}}, [{{x[0-9]+}}, {{#?}}:lo12:.LCPI
16*9880d681SAndroid Build Coastguard Worker  ret fp128 %fpval
17*9880d681SAndroid Build Coastguard Worker}
18