1 ; RUN: llc -verify-machineinstrs < %s | FileCheck --check-prefix=P8 --check-prefix=CHECK %s
2 ; RUN: llc -mcpu=pwr9 -verify-machineinstrs < %s | FileCheck --check-prefix=P9 --check-prefix=CHECK %s
3 target datalayout = "e-m:e-i64:64-n32:64"
4 target triple = "powerpc64le-unknown-linux-gnu"
7 ; CHECK-DAG: subfic [[R0:[0-9]+]], 5, 64
8 ; CHECK-DAG: addi [[R1:[0-9]+]], 5, -64
9 ; CHECK-DAG: srd [[R2:[0-9]+]], 3, 5
10 ; CHECK-DAG: sld [[R3:[0-9]+]], 4, [[R0]]
11 ; CHECK-DAG: srd [[R4:[0-9]+]], 4, [[R1]]
12 ; CHECK-DAG: or [[R5:[0-9]+]], [[R2]], [[R3]]
13 ; CHECK-DAG: or 3, [[R5]], [[R4]]
14 ; CHECK-DAG: srd 4, 4, 5
16 define i128 @lshr(i128 %x, i128 %y) {
21 ; CHECK-DAG: subfic [[R0:[0-9]+]], 5, 64
22 ; CHECK-DAG: addi [[R1:[0-9]+]], 5, -64
23 ; CHECK-DAG: srd [[R2:[0-9]+]], 3, 5
24 ; CHECK-DAG: sld [[R3:[0-9]+]], 4, [[R0]]
25 ; CHECK-DAG: srad [[R4:[0-9]+]], 4, [[R1]]
26 ; CHECK-DAG: or [[R5:[0-9]+]], [[R2]], [[R3]]
27 ; CHECK-DAG: cmpwi [[R1]], 1
28 ; CHECK-DAG: srad 4, 4, 5
29 ; CHECK-DAG: isellt 3, [[R5]], [[R4]]
31 define i128 @ashr(i128 %x, i128 %y) {
36 ; CHECK-DAG: subfic [[R0:[0-9]+]], 5, 64
37 ; CHECK-DAG: addi [[R1:[0-9]+]], 5, -64
38 ; CHECK-DAG: sld [[R2:[0-9]+]], 4, 5
39 ; CHECK-DAG: srd [[R3:[0-9]+]], 3, [[R0]]
40 ; CHECK-DAG: sld [[R4:[0-9]+]], 3, [[R1]]
41 ; CHECK-DAG: or [[R5:[0-9]+]], [[R2]], [[R3]]
42 ; CHECK-DAG: or 4, [[R5]], [[R4]]
43 ; CHECK-DAG: sld 3, 3, 5
45 define i128 @shl(i128 %x, i128 %y) {
50 ; CHECK-LABEL: shl_v1i128:
59 define i128 @shl_v1i128(i128 %arg, i128 %amt) local_unnamed_addr #0 {
61 %0 = insertelement <1 x i128> undef, i128 %arg, i32 0
62 %1 = insertelement <1 x i128> undef, i128 %amt, i32 0
63 %2 = shl <1 x i128> %0, %1
64 %retval = extractelement <1 x i128> %2, i32 0
68 ; CHECK-LABEL: lshr_v1i128:
77 define i128 @lshr_v1i128(i128 %arg, i128 %amt) local_unnamed_addr #0 {
79 %0 = insertelement <1 x i128> undef, i128 %arg, i32 0
80 %1 = insertelement <1 x i128> undef, i128 %amt, i32 0
81 %2 = lshr <1 x i128> %0, %1
82 %retval = extractelement <1 x i128> %2, i32 0
86 ; Arithmetic shift right is not available as an operation on the vector registers.
87 ; CHECK-LABEL: ashr_v1i128:
88 ; CHECK-NOT: {{\b}}vsro
89 ; CHECK-NOT: {{\b}}vsr
91 define i128 @ashr_v1i128(i128 %arg, i128 %amt) local_unnamed_addr #0 {
93 %0 = insertelement <1 x i128> undef, i128 %arg, i32 0
94 %1 = insertelement <1 x i128> undef, i128 %amt, i32 0
95 %2 = ashr <1 x i128> %0, %1
96 %retval = extractelement <1 x i128> %2, i32 0