1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=powerpc64le-- -mcpu=pwr8 -verify-machineinstrs | FileCheck %s
3 ; RUN: llc < %s -mtriple=powerpc64-ibm-aix-xcoff -mcpu=pwr8 -verify-machineinstrs | FileCheck %s
5 define i32 @sub_zext_cmp_mask_same_size_result(i32 %x) {
6 ; CHECK-LABEL: sub_zext_cmp_mask_same_size_result:
8 ; CHECK-NEXT: clrldi 3, 3, 63
9 ; CHECK-NEXT: ori 3, 3, 65508
10 ; CHECK-NEXT: oris 3, 3, 65535
13 %c = icmp eq i32 %a, 0
14 %z = zext i1 %c to i32
19 define i32 @sub_zext_cmp_mask_wider_result(i8 %x) {
20 ; CHECK-LABEL: sub_zext_cmp_mask_wider_result:
22 ; CHECK-NEXT: clrldi 3, 3, 63
23 ; CHECK-NEXT: ori 3, 3, 26
27 %z = zext i1 %c to i32
32 define i8 @sub_zext_cmp_mask_narrower_result(i32 %x) {
33 ; CHECK-LABEL: sub_zext_cmp_mask_narrower_result:
35 ; CHECK-NEXT: clrldi 3, 3, 63
36 ; CHECK-NEXT: ori 3, 3, 46
39 %c = icmp eq i32 %a, 0
45 define i8 @add_zext_cmp_mask_same_size_result(i8 %x) {
46 ; CHECK-LABEL: add_zext_cmp_mask_same_size_result:
48 ; CHECK-NEXT: clrldi 3, 3, 63
49 ; CHECK-NEXT: xori 3, 3, 27
58 define i32 @add_zext_cmp_mask_wider_result(i8 %x) {
59 ; CHECK-LABEL: add_zext_cmp_mask_wider_result:
61 ; CHECK-NEXT: clrldi 3, 3, 63
62 ; CHECK-NEXT: xori 3, 3, 27
66 %z = zext i1 %c to i32
71 define i8 @add_zext_cmp_mask_narrower_result(i32 %x) {
72 ; CHECK-LABEL: add_zext_cmp_mask_narrower_result:
74 ; CHECK-NEXT: clrldi 3, 3, 63
75 ; CHECK-NEXT: xori 3, 3, 43
78 %c = icmp eq i32 %a, 0
84 define i32 @low_bit_select_constants_bigger_false_same_size_result(i32 %x) {
85 ; CHECK-LABEL: low_bit_select_constants_bigger_false_same_size_result:
87 ; CHECK-NEXT: clrldi 3, 3, 63
88 ; CHECK-NEXT: ori 3, 3, 42
91 %c = icmp eq i32 %a, 0
92 %r = select i1 %c, i32 42, i32 43
96 define i64 @low_bit_select_constants_bigger_false_wider_result(i32 %x) {
97 ; CHECK-LABEL: low_bit_select_constants_bigger_false_wider_result:
99 ; CHECK-NEXT: clrldi 3, 3, 63
100 ; CHECK-NEXT: ori 3, 3, 26
103 %c = icmp eq i32 %a, 0
104 %r = select i1 %c, i64 26, i64 27
108 define i16 @low_bit_select_constants_bigger_false_narrower_result(i32 %x) {
109 ; CHECK-LABEL: low_bit_select_constants_bigger_false_narrower_result:
111 ; CHECK-NEXT: clrldi 3, 3, 63
112 ; CHECK-NEXT: ori 3, 3, 36
115 %c = icmp eq i32 %a, 0
116 %r = select i1 %c, i16 36, i16 37
120 define i8 @low_bit_select_constants_bigger_true_same_size_result(i8 %x) {
121 ; CHECK-LABEL: low_bit_select_constants_bigger_true_same_size_result:
123 ; CHECK-NEXT: clrldi 3, 3, 63
124 ; CHECK-NEXT: li 4, -29
125 ; CHECK-NEXT: xor 3, 3, 4
128 %c = icmp eq i8 %a, 0
129 %r = select i1 %c, i8 227, i8 226
133 define i32 @low_bit_select_constants_bigger_true_wider_result(i8 %x) {
134 ; CHECK-LABEL: low_bit_select_constants_bigger_true_wider_result:
136 ; CHECK-NEXT: clrldi 3, 3, 63
137 ; CHECK-NEXT: xori 3, 3, 227
140 %c = icmp eq i8 %a, 0
141 %r = select i1 %c, i32 227, i32 226
145 define i8 @low_bit_select_constants_bigger_true_narrower_result(i16 %x) {
146 ; CHECK-LABEL: low_bit_select_constants_bigger_true_narrower_result:
148 ; CHECK-NEXT: clrldi 3, 3, 63
149 ; CHECK-NEXT: xori 3, 3, 41
152 %c = icmp eq i16 %a, 0
153 %r = select i1 %c, i8 41, i8 40