1 ; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-unknown \
2 ; RUN: -enable-ppc-quad-precision -verify-machineinstrs \
3 ; RUN: -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names < %s | FileCheck %s
6 define void @qp_trunc(fp128* nocapture readonly %a, fp128* nocapture %res) {
8 %0 = load fp128, fp128* %a, align 16
9 %1 = tail call fp128 @llvm.trunc.f128(fp128 %0)
10 store fp128 %1, fp128* %res, align 16
12 ; CHECK-LABEL: qp_trunc
13 ; CHECK: xsrqpi 1, v{{[0-9]+}}, v{{[0-9]+}}, 1
16 declare fp128 @llvm.trunc.f128(fp128 %Val)
18 define void @qp_rint(fp128* nocapture readonly %a, fp128* nocapture %res) {
20 %0 = load fp128, fp128* %a, align 16
21 %1 = tail call fp128 @llvm.rint.f128(fp128 %0)
22 store fp128 %1, fp128* %res, align 16
24 ; CHECK-LABEL: qp_rint
25 ; CHECK: xsrqpix 0, v{{[0-9]+}}, v{{[0-9]+}}, 3
28 declare fp128 @llvm.rint.f128(fp128 %Val)
30 define void @qp_nearbyint(fp128* nocapture readonly %a, fp128* nocapture %res) {
32 %0 = load fp128, fp128* %a, align 16
33 %1 = tail call fp128 @llvm.nearbyint.f128(fp128 %0)
34 store fp128 %1, fp128* %res, align 16
36 ; CHECK-LABEL: qp_nearbyint
37 ; CHECK: xsrqpi 0, v{{[0-9]+}}, v{{[0-9]+}}, 3
40 declare fp128 @llvm.nearbyint.f128(fp128 %Val)
42 define void @qp_round(fp128* nocapture readonly %a, fp128* nocapture %res) {
44 %0 = load fp128, fp128* %a, align 16
45 %1 = tail call fp128 @llvm.round.f128(fp128 %0)
46 store fp128 %1, fp128* %res, align 16
48 ; CHECK-LABEL: qp_round
49 ; CHECK: xsrqpi 0, v{{[0-9]+}}, v{{[0-9]+}}, 0
52 declare fp128 @llvm.round.f128(fp128 %Val)
54 define void @qp_floor(fp128* nocapture readonly %a, fp128* nocapture %res) {
56 %0 = load fp128, fp128* %a, align 16
57 %1 = tail call fp128 @llvm.floor.f128(fp128 %0)
58 store fp128 %1, fp128* %res, align 16
60 ; CHECK-LABEL: qp_floor
61 ; CHECK: xsrqpi 1, v{{[0-9]+}}, v{{[0-9]+}}, 3
64 declare fp128 @llvm.floor.f128(fp128 %Val)
66 define void @qp_ceil(fp128* nocapture readonly %a, fp128* nocapture %res) {
68 %0 = load fp128, fp128* %a, align 16
69 %1 = tail call fp128 @llvm.ceil.f128(fp128 %0)
70 store fp128 %1, fp128* %res, align 16
72 ; CHECK-LABEL: qp_ceil
73 ; CHECK: xsrqpi 1, v{{[0-9]+}}, v{{[0-9]+}}, 2
76 declare fp128 @llvm.ceil.f128(fp128 %Val)