xref: /aosp_15_r20/external/llvm/test/CodeGen/PowerPC/swaps-le-3.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mcpu=pwr8 -mtriple=powerpc64le-unknown-linux-gnu -O3 < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; This test verifies that VSX swap optimization works for the
4*9880d681SAndroid Build Coastguard Worker; doubleword splat idiom.
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker@a = external global <2 x double>, align 16
7*9880d681SAndroid Build Coastguard Worker@b = external global <2 x double>, align 16
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Workerdefine void @test(double %s) {
10*9880d681SAndroid Build Coastguard Workerentry:
11*9880d681SAndroid Build Coastguard Worker  %0 = insertelement <2 x double> undef, double %s, i32 0
12*9880d681SAndroid Build Coastguard Worker  %1 = shufflevector <2 x double> %0, <2 x double> undef, <2 x i32> zeroinitializer
13*9880d681SAndroid Build Coastguard Worker  %2 = load <2 x double>, <2 x double>* @a, align 16
14*9880d681SAndroid Build Coastguard Worker  %3 = fadd <2 x double> %0, %2
15*9880d681SAndroid Build Coastguard Worker  store <2 x double> %3, <2 x double>* @b, align 16
16*9880d681SAndroid Build Coastguard Worker  ret void
17*9880d681SAndroid Build Coastguard Worker}
18*9880d681SAndroid Build Coastguard Worker
19*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: @test
20*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: xxspltd
21*9880d681SAndroid Build Coastguard Worker; CHECK-DAG: lxvd2x
22*9880d681SAndroid Build Coastguard Worker; CHECK: xvadddp
23*9880d681SAndroid Build Coastguard Worker; CHECK: stxvd2x
24*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: xxswapd
25