1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=powerpc64le-- -verify-machineinstrs | FileCheck %s
3 ; RUN: llc < %s -mtriple=powerpc64-ibm-aix-xcoff -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: clrlwi 3, 3, 31
49 ; CHECK-NEXT: subfic 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: clrlwi 3, 3, 31
62 ; CHECK-NEXT: subfic 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: clrlwi 3, 3, 31
75 ; CHECK-NEXT: subfic 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: subfic 3, 3, -29
127 %c = icmp eq i8 %a, 0
128 %r = select i1 %c, i8 227, i8 226
132 define i32 @low_bit_select_constants_bigger_true_wider_result(i8 %x) {
133 ; CHECK-LABEL: low_bit_select_constants_bigger_true_wider_result:
135 ; CHECK-NEXT: clrldi 3, 3, 63
136 ; CHECK-NEXT: subfic 3, 3, 227
139 %c = icmp eq i8 %a, 0
140 %r = select i1 %c, i32 227, i32 226
144 define i8 @low_bit_select_constants_bigger_true_narrower_result(i16 %x) {
145 ; CHECK-LABEL: low_bit_select_constants_bigger_true_narrower_result:
147 ; CHECK-NEXT: clrldi 3, 3, 63
148 ; CHECK-NEXT: subfic 3, 3, 41
151 %c = icmp eq i16 %a, 0
152 %r = select i1 %c, i8 41, i8 40