Stefan Pintilie | 927e8bf | 2018-10-23 17:11:36 +0000 | [diff] [blame] | 1 | ; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-unknown \ |
| 2 | ; RUN: -enable-ppc-quad-precision -verify-machineinstrs \ |
| 3 | ; RUN: -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | FileCheck %s |
| 4 | ; RUN: llc -mcpu=pwr9 -mtriple=powerpc64-unknown-unknown \ |
| 5 | ; RUN: -enable-ppc-quad-precision -verify-machineinstrs \ |
| 6 | ; RUN: -ppc-asm-full-reg-names \ |
| 7 | ; RUN: -ppc-vsr-nums-as-vr < %s | FileCheck %s --check-prefix=CHECK-BE |
| 8 | |
| 9 | ; Function Attrs: norecurse nounwind readnone |
| 10 | define i64 @getPart1(fp128 %in) local_unnamed_addr { |
| 11 | entry: |
| 12 | %0 = bitcast fp128 %in to i128 |
| 13 | %a.sroa.0.0.extract.trunc = trunc i128 %0 to i64 |
| 14 | ret i64 %a.sroa.0.0.extract.trunc |
| 15 | ; CHECK-LABEL: getPart1 |
| 16 | ; CHECK: mfvsrld r3, v2 |
| 17 | ; CHECK-NEXT: blr |
| 18 | ; CHECK-BE-LABEL: getPart1 |
| 19 | ; CHECK-BE: mfvsrld r3, v2 |
| 20 | ; CHECK-BE-NEXT: blr |
| 21 | } |
| 22 | |
| 23 | ; Function Attrs: norecurse nounwind readnone |
| 24 | define i64 @getPart2(fp128 %in) local_unnamed_addr { |
| 25 | entry: |
| 26 | %0 = bitcast fp128 %in to i128 |
| 27 | %a.sroa.0.8.extract.shift = lshr i128 %0, 64 |
| 28 | %a.sroa.0.8.extract.trunc = trunc i128 %a.sroa.0.8.extract.shift to i64 |
| 29 | ret i64 %a.sroa.0.8.extract.trunc |
| 30 | ; CHECK-LABEL: getPart2 |
| 31 | ; CHECK: mfvsrd r3, v2 |
| 32 | ; CHECK-NEXT: blr |
| 33 | ; CHECK-BE-LABEL: getPart2 |
| 34 | ; CHECK-BE: mfvsrd r3, v2 |
| 35 | ; CHECK-BE-NEXT: blr |
| 36 | } |
| 37 | |
| 38 | ; Function Attrs: norecurse nounwind readnone |
| 39 | define i64 @checkBitcast(fp128 %in, <2 x i64> %in2, <2 x i64> *%out) local_unnamed_addr { |
| 40 | entry: |
| 41 | %0 = bitcast fp128 %in to <2 x i64> |
| 42 | %1 = extractelement <2 x i64> %0, i64 0 |
| 43 | %2 = add <2 x i64> %0, %in2 |
| 44 | store <2 x i64> %2, <2 x i64> *%out, align 16 |
| 45 | ret i64 %1 |
| 46 | ; CHECK-LABEL: checkBitcast |
| 47 | ; CHECK: mfvsrld r3, v2 |
| 48 | ; CHECK: blr |
| 49 | ; CHECK-BE-LABEL: checkBitcast |
| 50 | ; CHECK-BE: mfvsrd r3, v2 |
| 51 | ; CHECK-BE: blr |
| 52 | } |
| 53 | |