1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
|
; RUN: llc < %s -mtriple=ve-unknown-unknown | FileCheck %s
define signext i8 @func8s(i8 signext %a, i8 signext %b) {
; CHECK-LABEL: func8s:
; CHECK: # %bb.0:
; CHECK-NEXT: nnd %s0, %s0, %s1
; CHECK-NEXT: b.l.t (, %s10)
%not = xor i8 %a, -1
%res = and i8 %not, %b
ret i8 %res
}
define zeroext i8 @func8z(i8 zeroext %a, i8 zeroext %b) {
; CHECK-LABEL: func8z:
; CHECK: # %bb.0:
; CHECK-NEXT: nnd %s0, %s0, %s1
; CHECK-NEXT: b.l.t (, %s10)
%not = xor i8 %a, -1
%res = and i8 %b, %not
ret i8 %res
}
define signext i8 @funci8s(i8 signext %a) {
; CHECK-LABEL: funci8s:
; CHECK: # %bb.0:
; CHECK-NEXT: or %s1, 5, (0)1
; CHECK-NEXT: nnd %s0, %s0, %s1
; CHECK-NEXT: b.l.t (, %s10)
%not = xor i8 %a, -1
%res = and i8 %not, 5
ret i8 %res
}
define zeroext i8 @funci8z(i8 zeroext %a) {
; CHECK-LABEL: funci8z:
; CHECK: # %bb.0:
; CHECK-NEXT: lea %s1, 251
; CHECK-NEXT: nnd %s0, %s0, %s1
; CHECK-NEXT: b.l.t (, %s10)
%not = xor i8 %a, -1
%res = and i8 -5, %not
ret i8 %res
}
define signext i16 @func16s(i16 signext %a, i16 signext %b) {
; CHECK-LABEL: func16s:
; CHECK: # %bb.0:
; CHECK-NEXT: nnd %s0, %s0, %s1
; CHECK-NEXT: b.l.t (, %s10)
%not = xor i16 %a, -1
%res = and i16 %not, %b
ret i16 %res
}
define zeroext i16 @func16z(i16 zeroext %a, i16 zeroext %b) {
; CHECK-LABEL: func16z:
; CHECK: # %bb.0:
; CHECK-NEXT: nnd %s0, %s0, %s1
; CHECK-NEXT: b.l.t (, %s10)
%not = xor i16 %a, -1
%res = and i16 %b, %not
ret i16 %res
}
define signext i16 @funci16s(i16 signext %a) {
; CHECK-LABEL: funci16s:
; CHECK: # %bb.0:
; CHECK-NEXT: xor %s0, -1, %s0
; CHECK-NEXT: b.l.t (, %s10)
%not = xor i16 %a, -1
%res = and i16 %not, 65535
ret i16 %res
}
define zeroext i16 @funci16z(i16 zeroext %a) {
; CHECK-LABEL: funci16z:
; CHECK: # %bb.0:
; CHECK-NEXT: nnd %s0, %s0, (52)0
; CHECK-NEXT: b.l.t (, %s10)
%not = xor i16 %a, -1
%res = and i16 4095, %not
ret i16 %res
}
define signext i32 @func32s(i32 signext %a, i32 signext %b) {
; CHECK-LABEL: func32s:
; CHECK: # %bb.0:
; CHECK-NEXT: nnd %s0, %s0, %s1
; CHECK-NEXT: b.l.t (, %s10)
%not = xor i32 %a, -1
%res = and i32 %not, %b
ret i32 %res
}
define zeroext i32 @func32z(i32 zeroext %a, i32 zeroext %b) {
; CHECK-LABEL: func32z:
; CHECK: # %bb.0:
; CHECK-NEXT: nnd %s0, %s0, %s1
; CHECK-NEXT: b.l.t (, %s10)
%not = xor i32 %a, -1
%res = and i32 %not, %b
ret i32 %res
}
define signext i32 @funci32s(i32 signext %a) {
; CHECK-LABEL: funci32s:
; CHECK: # %bb.0:
; CHECK-NEXT: nnd %s0, %s0, (36)0
; CHECK-NEXT: b.l.t (, %s10)
%not = xor i32 %a, -1
%res = and i32 %not, 268435455
ret i32 %res
}
define zeroext i32 @funci32z(i32 zeroext %a) {
; CHECK-LABEL: funci32z:
; CHECK: # %bb.0:
; CHECK-NEXT: nnd %s0, %s0, (36)0
; CHECK-NEXT: b.l.t (, %s10)
%not = xor i32 %a, -1
%res = and i32 %not, 268435455
ret i32 %res
}
define i64 @func64(i64 %a, i64 %b) {
; CHECK-LABEL: func64:
; CHECK: # %bb.0:
; CHECK-NEXT: nnd %s0, %s0, %s1
; CHECK-NEXT: b.l.t (, %s10)
%not = xor i64 %a, -1
%res = and i64 %not, %b
ret i64 %res
}
define i64 @func64_2(i64 %a, i64 %b) {
; CHECK-LABEL: func64_2:
; CHECK: # %bb.0:
; CHECK-NEXT: nnd %s0, %s1, %s0
; CHECK-NEXT: b.l.t (, %s10)
%not = xor i64 %b, -1
%res = and i64 %not, %a
ret i64 %res
}
define i64 @func64i(i64 %a) {
; CHECK-LABEL: func64i:
; CHECK: # %bb.0:
; CHECK-NEXT: nnd %s0, %s0, (24)0
; CHECK-NEXT: b.l.t (, %s10)
%not = xor i64 %a, -1
%res = and i64 %not, 1099511627775
ret i64 %res
}
define i128 @func128(i128 %a, i128 %b) {
; CHECK-LABEL: func128:
; CHECK: # %bb.0:
; CHECK-NEXT: nnd %s0, %s0, %s2
; CHECK-NEXT: nnd %s1, %s1, %s3
; CHECK-NEXT: b.l.t (, %s10)
%not = xor i128 %a, -1
%res = and i128 %b, %not
ret i128 %res
}
define i128 @funci128(i128 %a) {
; CHECK-LABEL: funci128:
; CHECK: # %bb.0:
; CHECK-NEXT: or %s1, 5, (0)1
; CHECK-NEXT: nnd %s0, %s0, %s1
; CHECK-NEXT: or %s1, 0, (0)1
; CHECK-NEXT: b.l.t (, %s10)
%not = xor i128 %a, -1
%res = and i128 %not, 5
ret i128 %res
}
define i64 @func64_nnd_fold(i64 %x, i64 %y, i64 %m) {
; CHECK-LABEL: func64_nnd_fold:
; CHECK: # %bb.0:
; CHECK-NEXT: nnd %s1, %s2, %s1
; CHECK-NEXT: and %s0, %s0, %s2
; CHECK-NEXT: or %s0, %s0, %s1
; CHECK-NEXT: b.l.t (, %s10)
%D = xor i64 %x, %y
%A = and i64 %D, %m
%res = xor i64 %A, %y
ret i64 %res
}
define i64 @func64iy_nnd_fold(i64 %x, i64 %m) {
; CHECK-LABEL: func64iy_nnd_fold:
; CHECK: # %bb.0:
; CHECK-NEXT: nnd %s0, %s0, %s1
; CHECK-NEXT: or %s1, -64, %s1
; CHECK-NEXT: nnd %s0, %s0, %s1
; CHECK-NEXT: b.l.t (, %s10)
%D = xor i64 %x, -64
%A = and i64 %D, %m
%res = xor i64 %A, -64
ret i64 %res
}
define i64 @func64im_nnd_fold(i64 %x, i64 %y) {
; CHECK-LABEL: func64im_nnd_fold:
; CHECK: # %bb.0:
; CHECK-NEXT: xor %s0, %s0, %s1
; CHECK-NEXT: and %s0, 30, %s0
; CHECK-NEXT: xor %s0, %s0, %s1
; CHECK-NEXT: b.l.t (, %s10)
%D = xor i64 %x, %y
%A = and i64 %D, 30
%res = xor i64 %A, %y
ret i64 %res
}
|