1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-unknown \
3 ; RUN: -mcpu=pwr9 | FileCheck %s
4 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-unknown \
5 ; RUN: -mcpu=pwr9 -mattr=-altivec | FileCheck %s --check-prefix=NO-ALTIVEC
7 declare i64 @llvm.bswap.i64(i64)
9 define i64 @bswap64(i64 %x) {
10 ; CHECK-LABEL: bswap64:
11 ; CHECK: # %bb.0: # %entry
12 ; CHECK-NEXT: mtvsrdd 34, 3, 3
13 ; CHECK-NEXT: xxbrd 0, 34
14 ; CHECK-NEXT: mfvsrd 3, 0
17 ; NO-ALTIVEC-LABEL: bswap64:
18 ; NO-ALTIVEC: # %bb.0: # %entry
19 ; NO-ALTIVEC-NEXT: rotldi 5, 3, 16
20 ; NO-ALTIVEC-NEXT: rotldi 4, 3, 8
21 ; NO-ALTIVEC-NEXT: rldimi 4, 5, 8, 48
22 ; NO-ALTIVEC-NEXT: rotldi 5, 3, 24
23 ; NO-ALTIVEC-NEXT: rldimi 4, 5, 16, 40
24 ; NO-ALTIVEC-NEXT: rotldi 5, 3, 32
25 ; NO-ALTIVEC-NEXT: rldimi 4, 5, 24, 32
26 ; NO-ALTIVEC-NEXT: rotldi 5, 3, 48
27 ; NO-ALTIVEC-NEXT: rldimi 4, 5, 40, 16
28 ; NO-ALTIVEC-NEXT: rotldi 5, 3, 56
29 ; NO-ALTIVEC-NEXT: rldimi 4, 5, 48, 8
30 ; NO-ALTIVEC-NEXT: rldimi 4, 3, 56, 0
31 ; NO-ALTIVEC-NEXT: mr 3, 4
32 ; NO-ALTIVEC-NEXT: blr
34 %0 = call i64 @llvm.bswap.i64(i64 %x)