1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-linux-gnu < %s \
3 ; RUN: | FileCheck --check-prefix=CHECK-LE %s
4 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-linux-gnu -mattr=+vsx < %s \
5 ; RUN: | FileCheck --check-prefix=CHECK-BE %s
6 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-ibm-aix-xcoff -mattr=+vsx \
7 ; RUN: -vec-extabi < %s | FileCheck --check-prefix=CHECK-BE %s
8 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-linux-gnu -mcpu=pwr9 < %s \
9 ; RUN: | FileCheck --check-prefix=CHECK-P9LE %s
10 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-linux-gnu -mcpu=pwr9 < %s \
11 ; RUN: | FileCheck --check-prefix=CHECK-P9BE %s
12 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-ibm-aix-xcoff -mcpu=pwr9 \
13 ; RUN: -vec-extabi < %s | FileCheck --check-prefix=CHECK-BE %s
15 define double @splat_swap(<2 x double> %x, <2 x double> %y) nounwind {
16 ; CHECK-LE-LABEL: splat_swap:
18 ; CHECK-LE-NEXT: xvadddp 0, 34, 35
19 ; CHECK-LE-NEXT: xvrdpic 0, 0
20 ; CHECK-LE-NEXT: xxswapd 1, 0
21 ; CHECK-LE-NEXT: xssubdp 1, 1, 0
24 ; CHECK-BE-LABEL: splat_swap:
26 ; CHECK-BE-NEXT: xvadddp 0, 34, 35
27 ; CHECK-BE-NEXT: xvrdpic 0, 0
28 ; CHECK-BE-NEXT: xxswapd 1, 0
29 ; CHECK-BE-NEXT: xssubdp 1, 0, 1
32 ; CHECK-P9LE-LABEL: splat_swap:
33 ; CHECK-P9LE: # %bb.0:
34 ; CHECK-P9LE-NEXT: xvadddp 0, 34, 35
35 ; CHECK-P9LE-NEXT: xvrdpic 0, 0
36 ; CHECK-P9LE-NEXT: xxswapd 1, 0
37 ; CHECK-P9LE-NEXT: xssubdp 1, 1, 0
38 ; CHECK-P9LE-NEXT: blr
40 ; CHECK-P9BE-LABEL: splat_swap:
41 ; CHECK-P9BE: # %bb.0:
42 ; CHECK-P9BE-NEXT: xvadddp 0, 34, 35
43 ; CHECK-P9BE-NEXT: xvrdpic 0, 0
44 ; CHECK-P9BE-NEXT: xxswapd 1, 0
45 ; CHECK-P9BE-NEXT: xssubdp 1, 0, 1
46 ; CHECK-P9BE-NEXT: blr
47 %added = fadd <2 x double> %x, %y
48 %call = tail call <2 x double> @llvm.rint.v2f64(<2 x double> %added) nounwind readnone
49 %res1 = extractelement <2 x double> %call, i32 0
50 %res2 = extractelement <2 x double> %call, i32 1
51 %ret = fsub double %res1, %res2
55 declare <2 x double> @llvm.rint.v2f64(<2 x double>)