xref: /llvm-project/llvm/test/CodeGen/PowerPC/aix_scalar_vector_permuted.ll (revision b922a3621116b404d868af8b74cab25ab78555be)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -mcpu=pwr8 -verify-machineinstrs -ppc-vsr-nums-as-vr \
3; RUN:   -ppc-asm-full-reg-names -mtriple=powerpc64-ibm-aix-xcoff < %s | \
4; RUN: FileCheck %s --check-prefix=AIX-P8-64
5; RUN: llc -mcpu=pwr8 -verify-machineinstrs -ppc-vsr-nums-as-vr \
6; RUN:   -ppc-asm-full-reg-names -mtriple=powerpc-ibm-aix-xcoff < %s | \
7; RUN: FileCheck %s --check-prefix=AIX-P8-32
8; RUN: llc -mcpu=pwr9 -verify-machineinstrs -ppc-vsr-nums-as-vr \
9; RUN:   -ppc-asm-full-reg-names -mtriple=powerpc64-ibm-aix-xcoff < %s | \
10; RUN: FileCheck %s --check-prefix=AIX-P9-64
11; RUN: llc -mcpu=pwr9 -verify-machineinstrs -ppc-vsr-nums-as-vr \
12; RUN:   -ppc-asm-full-reg-names -mtriple=powerpc-ibm-aix-xcoff < %s | \
13; RUN: FileCheck %s --check-prefix=AIX-P9-32
14
15%d8 = type <8 x double>
16%f1 = type <1 x float>
17%f2 = type <2 x float>
18%f4 = type <4 x float>
19%f8 = type <8 x float>
20%i4 = type <4 x i32>
21
22define void @test_f2(ptr %P, ptr %Q, ptr %S) {
23; AIX-P8-64-LABEL: test_f2:
24; AIX-P8-64:       # %bb.0:
25; AIX-P8-64-NEXT:    lfdx f0, 0, r3
26; AIX-P8-64-NEXT:    lfdx f1, 0, r4
27; AIX-P8-64-NEXT:    xvaddsp vs0, vs0, vs1
28; AIX-P8-64-NEXT:    stfdx f0, 0, r5
29; AIX-P8-64-NEXT:    blr
30;
31; AIX-P8-32-LABEL: test_f2:
32; AIX-P8-32:       # %bb.0:
33; AIX-P8-32-NEXT:    li r6, 4
34; AIX-P8-32-NEXT:    lxsiwzx v3, 0, r3
35; AIX-P8-32-NEXT:    lxsiwzx v4, 0, r4
36; AIX-P8-32-NEXT:    lxsiwzx v2, r3, r6
37; AIX-P8-32-NEXT:    vmrgow v2, v3, v2
38; AIX-P8-32-NEXT:    lxsiwzx v3, r4, r6
39; AIX-P8-32-NEXT:    vmrgow v3, v4, v3
40; AIX-P8-32-NEXT:    xvaddsp vs0, v2, v3
41; AIX-P8-32-NEXT:    xxsldwi vs1, vs0, vs0, 1
42; AIX-P8-32-NEXT:    xscvspdpn f0, vs0
43; AIX-P8-32-NEXT:    stfs f0, 0(r5)
44; AIX-P8-32-NEXT:    xscvspdpn f0, vs1
45; AIX-P8-32-NEXT:    stfs f0, 4(r5)
46; AIX-P8-32-NEXT:    blr
47;
48; AIX-P9-64-LABEL: test_f2:
49; AIX-P9-64:       # %bb.0:
50; AIX-P9-64-NEXT:    lfd f0, 0(r3)
51; AIX-P9-64-NEXT:    lfd f1, 0(r4)
52; AIX-P9-64-NEXT:    xvaddsp vs0, vs0, vs1
53; AIX-P9-64-NEXT:    stfd f0, 0(r5)
54; AIX-P9-64-NEXT:    blr
55;
56; AIX-P9-32-LABEL: test_f2:
57; AIX-P9-32:       # %bb.0:
58; AIX-P9-32-NEXT:    li r6, 4
59; AIX-P9-32-NEXT:    lxsiwzx v3, 0, r3
60; AIX-P9-32-NEXT:    lxsiwzx v4, 0, r4
61; AIX-P9-32-NEXT:    lxsiwzx v2, r3, r6
62; AIX-P9-32-NEXT:    vmrgow v2, v3, v2
63; AIX-P9-32-NEXT:    lxsiwzx v3, r4, r6
64; AIX-P9-32-NEXT:    vmrgow v3, v4, v3
65; AIX-P9-32-NEXT:    xvaddsp vs0, v2, v3
66; AIX-P9-32-NEXT:    xscvspdpn f1, vs0
67; AIX-P9-32-NEXT:    xxsldwi vs0, vs0, vs0, 1
68; AIX-P9-32-NEXT:    xscvspdpn f0, vs0
69; AIX-P9-32-NEXT:    stfs f1, 0(r5)
70; AIX-P9-32-NEXT:    stfs f0, 4(r5)
71; AIX-P9-32-NEXT:    blr
72  %p = load %f2, ptr %P
73  %q = load %f2, ptr %Q
74  %R = fadd %f2 %p, %q
75  store %f2 %R, ptr %S
76  ret void
77}
78
79