2017-07-08 00:41:55 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
|
|
; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 < %s | FileCheck %s
|
|
|
|
; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 < %s | FileCheck %s
|
|
|
|
declare i32 @llvm.bitreverse.i32(i32)
|
|
|
|
define i32 @testBitReverseIntrinsicI32(i32 %arg) {
|
|
|
|
; CHECK-LABEL: testBitReverseIntrinsicI32:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-07-08 00:41:55 +08:00
|
|
|
; CHECK-NEXT: lis 4, -21846
|
|
|
|
; CHECK-NEXT: lis 5, 21845
|
|
|
|
; CHECK-NEXT: slwi 6, 3, 1
|
|
|
|
; CHECK-NEXT: srwi 3, 3, 1
|
|
|
|
; CHECK-NEXT: ori 4, 4, 43690
|
|
|
|
; CHECK-NEXT: ori 5, 5, 21845
|
|
|
|
; CHECK-NEXT: and 4, 6, 4
|
2018-07-05 02:54:25 +08:00
|
|
|
; CHECK-NEXT: and 3, 3, 5
|
|
|
|
; CHECK-NEXT: lis 5, 13107
|
2017-07-08 00:41:55 +08:00
|
|
|
; CHECK-NEXT: or 3, 3, 4
|
2018-07-05 02:54:25 +08:00
|
|
|
; CHECK-NEXT: lis 4, -13108
|
|
|
|
; CHECK-NEXT: ori 5, 5, 13107
|
|
|
|
; CHECK-NEXT: slwi 6, 3, 2
|
|
|
|
; CHECK-NEXT: ori 4, 4, 52428
|
2017-07-08 00:41:55 +08:00
|
|
|
; CHECK-NEXT: srwi 3, 3, 2
|
2018-07-05 02:54:25 +08:00
|
|
|
; CHECK-NEXT: and 4, 6, 4
|
2017-07-08 00:41:55 +08:00
|
|
|
; CHECK-NEXT: and 3, 3, 5
|
2018-07-05 02:54:25 +08:00
|
|
|
; CHECK-NEXT: lis 5, 3855
|
2017-07-08 00:41:55 +08:00
|
|
|
; CHECK-NEXT: or 3, 3, 4
|
2018-07-05 02:54:25 +08:00
|
|
|
; CHECK-NEXT: lis 4, -3856
|
|
|
|
; CHECK-NEXT: ori 5, 5, 3855
|
|
|
|
; CHECK-NEXT: slwi 6, 3, 4
|
|
|
|
; CHECK-NEXT: ori 4, 4, 61680
|
2017-07-08 00:41:55 +08:00
|
|
|
; CHECK-NEXT: srwi 3, 3, 4
|
2018-07-05 02:54:25 +08:00
|
|
|
; CHECK-NEXT: and 4, 6, 4
|
2017-07-08 00:41:55 +08:00
|
|
|
; CHECK-NEXT: and 3, 3, 5
|
|
|
|
; CHECK-NEXT: or 3, 3, 4
|
|
|
|
; CHECK-NEXT: rotlwi 4, 3, 24
|
|
|
|
; CHECK-NEXT: rlwimi 4, 3, 8, 8, 15
|
|
|
|
; CHECK-NEXT: rlwimi 4, 3, 8, 24, 31
|
|
|
|
; CHECK-NEXT: rldicl 3, 4, 0, 32
|
|
|
|
; CHECK-NEXT: blr
|
|
|
|
%res = call i32 @llvm.bitreverse.i32(i32 %arg)
|
|
|
|
ret i32 %res
|
|
|
|
}
|
2017-07-11 02:11:23 +08:00
|
|
|
|
|
|
|
declare i64 @llvm.bitreverse.i64(i64)
|
|
|
|
define i64 @testBitReverseIntrinsicI64(i64 %arg) {
|
|
|
|
; CHECK-LABEL: testBitReverseIntrinsicI64:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2017-07-11 02:11:23 +08:00
|
|
|
; CHECK-NEXT: lis 4, -21846
|
|
|
|
; CHECK-NEXT: lis 5, 21845
|
2018-09-03 11:14:29 +08:00
|
|
|
; CHECK-NEXT: lis 7, -13108
|
|
|
|
; CHECK-NEXT: lis 8, 13107
|
2017-07-11 02:11:23 +08:00
|
|
|
; CHECK-NEXT: ori 4, 4, 43690
|
|
|
|
; CHECK-NEXT: ori 5, 5, 21845
|
2018-09-03 11:14:29 +08:00
|
|
|
; CHECK-NEXT: ori 7, 7, 52428
|
|
|
|
; CHECK-NEXT: ori 8, 8, 13107
|
2017-07-11 02:11:23 +08:00
|
|
|
; CHECK-NEXT: sldi 4, 4, 32
|
|
|
|
; CHECK-NEXT: sldi 5, 5, 32
|
|
|
|
; CHECK-NEXT: oris 4, 4, 43690
|
|
|
|
; CHECK-NEXT: oris 5, 5, 21845
|
2018-09-03 11:14:29 +08:00
|
|
|
; CHECK-NEXT: sldi 6, 3, 1
|
|
|
|
; CHECK-NEXT: rldicl 3, 3, 63, 1
|
2017-07-11 02:11:23 +08:00
|
|
|
; CHECK-NEXT: ori 4, 4, 43690
|
|
|
|
; CHECK-NEXT: ori 5, 5, 21845
|
2018-09-03 11:14:29 +08:00
|
|
|
; CHECK-NEXT: sldi 7, 7, 32
|
|
|
|
; CHECK-NEXT: sldi 8, 8, 32
|
|
|
|
; CHECK-NEXT: and 4, 6, 4
|
2017-07-11 02:11:23 +08:00
|
|
|
; CHECK-NEXT: and 3, 3, 5
|
2018-09-03 11:14:29 +08:00
|
|
|
; CHECK-NEXT: lis 5, -3856
|
|
|
|
; CHECK-NEXT: oris 6, 7, 52428
|
|
|
|
; CHECK-NEXT: oris 7, 8, 13107
|
2017-07-11 02:11:23 +08:00
|
|
|
; CHECK-NEXT: or 3, 3, 4
|
2018-09-03 11:14:29 +08:00
|
|
|
; CHECK-NEXT: lis 4, 3855
|
|
|
|
; CHECK-NEXT: ori 5, 5, 61680
|
|
|
|
; CHECK-NEXT: ori 6, 6, 52428
|
|
|
|
; CHECK-NEXT: ori 7, 7, 13107
|
|
|
|
; CHECK-NEXT: ori 4, 4, 3855
|
2017-07-11 02:11:23 +08:00
|
|
|
; CHECK-NEXT: sldi 8, 3, 2
|
|
|
|
; CHECK-NEXT: rldicl 3, 3, 62, 2
|
2018-09-03 11:14:29 +08:00
|
|
|
; CHECK-NEXT: and 6, 8, 6
|
|
|
|
; CHECK-NEXT: and 3, 3, 7
|
|
|
|
; CHECK-NEXT: sldi 5, 5, 32
|
|
|
|
; CHECK-NEXT: sldi 4, 4, 32
|
|
|
|
; CHECK-NEXT: or 3, 3, 6
|
|
|
|
; CHECK-NEXT: oris 5, 5, 61680
|
|
|
|
; CHECK-NEXT: oris 4, 4, 3855
|
2017-07-11 02:11:23 +08:00
|
|
|
; CHECK-NEXT: sldi 6, 3, 4
|
2018-09-03 11:14:29 +08:00
|
|
|
; CHECK-NEXT: ori 5, 5, 61680
|
|
|
|
; CHECK-NEXT: ori 4, 4, 3855
|
2017-07-11 02:11:23 +08:00
|
|
|
; CHECK-NEXT: rldicl 3, 3, 60, 4
|
2018-09-03 11:14:29 +08:00
|
|
|
; CHECK-NEXT: and 5, 6, 5
|
|
|
|
; CHECK-NEXT: and 3, 3, 4
|
|
|
|
; CHECK-NEXT: or 3, 3, 5
|
2017-07-11 02:11:23 +08:00
|
|
|
; CHECK-NEXT: rldicl 4, 3, 32, 32
|
2018-07-05 02:54:25 +08:00
|
|
|
; CHECK-NEXT: rlwinm 5, 3, 24, 0, 31
|
2017-10-31 00:03:44 +08:00
|
|
|
; CHECK-NEXT: rlwinm 6, 4, 24, 0, 31
|
|
|
|
; CHECK-NEXT: rlwimi 5, 3, 8, 8, 15
|
|
|
|
; CHECK-NEXT: rlwimi 5, 3, 8, 24, 31
|
2018-07-05 02:54:25 +08:00
|
|
|
; CHECK-NEXT: rlwimi 6, 4, 8, 8, 15
|
2017-10-31 00:03:44 +08:00
|
|
|
; CHECK-NEXT: rlwimi 6, 4, 8, 24, 31
|
|
|
|
; CHECK-NEXT: sldi 3, 5, 32
|
|
|
|
; CHECK-NEXT: or 3, 3, 6
|
2017-07-11 02:11:23 +08:00
|
|
|
; CHECK-NEXT: blr
|
|
|
|
%res = call i64 @llvm.bitreverse.i64(i64 %arg)
|
|
|
|
ret i64 %res
|
|
|
|
}
|