1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=powerpc64le-- -verify-machineinstrs | FileCheck %s
4 define i32 @sub_zext_cmp_mask_same_size_result(i32 %x) {
5 ; CHECK-LABEL: sub_zext_cmp_mask_same_size_result:
7 ; CHECK-NEXT: clrldi 3, 3, 63
8 ; CHECK-NEXT: ori 3, 3, 65508
9 ; CHECK-NEXT: oris 3, 3, 65535
12 %c = icmp eq i32 %a, 0
13 %z = zext i1 %c to i32
18 define i32 @sub_zext_cmp_mask_wider_result(i8 %x) {
19 ; CHECK-LABEL: sub_zext_cmp_mask_wider_result:
21 ; CHECK-NEXT: clrldi 3, 3, 63
22 ; CHECK-NEXT: ori 3, 3, 26
26 %z = zext i1 %c to i32
31 define i8 @sub_zext_cmp_mask_narrower_result(i32 %x) {
32 ; CHECK-LABEL: sub_zext_cmp_mask_narrower_result:
34 ; CHECK-NEXT: clrldi 3, 3, 63
35 ; CHECK-NEXT: ori 3, 3, 46
38 %c = icmp eq i32 %a, 0
44 define i8 @add_zext_cmp_mask_same_size_result(i8 %x) {
45 ; CHECK-LABEL: add_zext_cmp_mask_same_size_result:
47 ; CHECK-NEXT: rlwinm 3, 3, 0, 31, 31
48 ; CHECK-NEXT: subfic 3, 3, 27
57 define i32 @add_zext_cmp_mask_wider_result(i8 %x) {
58 ; CHECK-LABEL: add_zext_cmp_mask_wider_result:
60 ; CHECK-NEXT: rlwinm 3, 3, 0, 31, 31
61 ; CHECK-NEXT: subfic 3, 3, 27
65 %z = zext i1 %c to i32
70 define i8 @add_zext_cmp_mask_narrower_result(i32 %x) {
71 ; CHECK-LABEL: add_zext_cmp_mask_narrower_result:
73 ; CHECK-NEXT: rlwinm 3, 3, 0, 31, 31
74 ; CHECK-NEXT: subfic 3, 3, 43
77 %c = icmp eq i32 %a, 0
83 define i32 @low_bit_select_constants_bigger_false_same_size_result(i32 %x) {
84 ; CHECK-LABEL: low_bit_select_constants_bigger_false_same_size_result:
86 ; CHECK-NEXT: clrldi 3, 3, 63
87 ; CHECK-NEXT: ori 3, 3, 42
90 %c = icmp eq i32 %a, 0
91 %r = select i1 %c, i32 42, i32 43
95 define i64 @low_bit_select_constants_bigger_false_wider_result(i32 %x) {
96 ; CHECK-LABEL: low_bit_select_constants_bigger_false_wider_result:
98 ; CHECK-NEXT: clrldi 3, 3, 63
99 ; CHECK-NEXT: ori 3, 3, 26
102 %c = icmp eq i32 %a, 0
103 %r = select i1 %c, i64 26, i64 27
107 define i16 @low_bit_select_constants_bigger_false_narrower_result(i32 %x) {
108 ; CHECK-LABEL: low_bit_select_constants_bigger_false_narrower_result:
110 ; CHECK-NEXT: clrldi 3, 3, 63
111 ; CHECK-NEXT: ori 3, 3, 36
114 %c = icmp eq i32 %a, 0
115 %r = select i1 %c, i16 36, i16 37
119 define i8 @low_bit_select_constants_bigger_true_same_size_result(i8 %x) {
120 ; CHECK-LABEL: low_bit_select_constants_bigger_true_same_size_result:
122 ; CHECK-NEXT: clrldi 3, 3, 63
123 ; CHECK-NEXT: subfic 3, 3, -29
126 %c = icmp eq i8 %a, 0
127 %r = select i1 %c, i8 227, i8 226
131 define i32 @low_bit_select_constants_bigger_true_wider_result(i8 %x) {
132 ; CHECK-LABEL: low_bit_select_constants_bigger_true_wider_result:
134 ; CHECK-NEXT: clrldi 3, 3, 63
135 ; CHECK-NEXT: subfic 3, 3, 227
138 %c = icmp eq i8 %a, 0
139 %r = select i1 %c, i32 227, i32 226
143 define i8 @low_bit_select_constants_bigger_true_narrower_result(i16 %x) {
144 ; CHECK-LABEL: low_bit_select_constants_bigger_true_narrower_result:
146 ; CHECK-NEXT: clrldi 3, 3, 63
147 ; CHECK-NEXT: subfic 3, 3, 41
150 %c = icmp eq i16 %a, 0
151 %r = select i1 %c, i8 41, i8 40