1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-linux-gnu | FileCheck %s
3 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu | FileCheck %s
4 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-ibm-aix-xcoff | FileCheck %s
6 define i64 @ori_test_1(i64 %a) {
7 ; CHECK-LABEL: ori_test_1:
8 ; CHECK: # %bb.0: # %entry
12 %or = or i64 %a, 18446744073709551615 ; 0xffffffffffffffff
16 define i64 @ori_test_2(i64 %a) {
17 ; CHECK-LABEL: ori_test_2:
18 ; CHECK: # %bb.0: # %entry
19 ; CHECK-NEXT: li 4, -1
20 ; CHECK-NEXT: rldimi 3, 4, 29, 15
23 %or = or i64 %a, 562949416550400 ; 0x1ffffe0000000
27 define i64 @ori_test_3(i64 %a) {
28 ; CHECK-LABEL: ori_test_3:
29 ; CHECK: # %bb.0: # %entry
30 ; CHECK-NEXT: li 4, -1
31 ; CHECK-NEXT: rldimi 3, 4, 3, 28
34 %or = or i64 %a, 68719476728 ; 0xffffffff8
38 define i64 @ori_test_4(i64 %a) {
39 ; CHECK-LABEL: ori_test_4:
40 ; CHECK: # %bb.0: # %entry
41 ; CHECK-NEXT: lis 4, -32640
42 ; CHECK-NEXT: ori 4, 4, 32903
43 ; CHECK-NEXT: rldicl 4, 4, 13, 19
44 ; CHECK-NEXT: or 3, 3, 4
47 %or = or i64 %a, 17661175070719 ; 0x10101010ffff
51 ; Don't exploit rldimi if operand has multiple uses
52 define i64 @test_test_5(i64 %a, i64 %b) {
53 ; CHECK-LABEL: test_test_5:
54 ; CHECK: # %bb.0: # %entry
56 ; CHECK-NEXT: rldic 5, 5, 32, 31
57 ; CHECK-NEXT: or 5, 3, 5
58 ; CHECK-NEXT: add 4, 5, 4
59 ; CHECK-NEXT: sub 3, 3, 4
62 %or = or i64 %a, 4294967296
63 %add = add i64 %or, %b
64 %div = sub i64 %a, %add