%C = add int %B, %B ; === shl int %A, 5
ret int %C
}
+
+bool %test10(ubyte %A, ubyte %b) {
+ %B = add ubyte %A, %b
+ %c = setne ubyte %B, 0 ; === A != -b
+ ret bool %c
+}
+
+bool %test11(ubyte %A) {
+ %B = add ubyte %A, 255
+ %c = setne ubyte %B, 0 ; === A != 1
+ ret bool %c
+}
ret bool %D
}
+bool %test14(ubyte %A) {
+ %B = and ubyte %A, 128
+ %C = setne ubyte %B, 0
+ ret bool %C
+}
ret short %c2
}
-bool %test11(ubyte %A, ubyte %B) {
- %C = sub ubyte %A, %B
- %cD = cast ubyte %C to bool ; == setne A, B
- ret bool %cD
-}
-
-bool %test12(ubyte %A) {
- %B = add ubyte %A, 255
- %c = cast ubyte %B to bool ; === A != 1
- ret bool %c
-}
-
-bool %test13(ubyte %A, ubyte %b) {
- %B = add ubyte %A, %b
- %c = cast ubyte %B to bool ; === A != -b
- ret bool %c
-}
-
-bool %test14(ubyte %A) {
- %B = xor ubyte %A, 4
- %c = cast ubyte %B to bool
- ret bool %c
-}
ret bool %C
}
-; These instructions can be turned into cast-to-bool
-bool %test15(sbyte %A, short %A, int %A, long %A) {
- %B1 = setne sbyte %A, 0
- %B2 = seteq short %A, 0
- %B3 = setne int %A, 0
- %B4 = seteq long %A, 0
- %C1 = or bool %B1, %B2
- %C2 = or bool %B3, %B4
- %D = or bool %C1, %C2
- ret bool %D
-}
-
bool %test16(uint %A) {
%B = and uint %A, 5
%C = seteq uint %B, 8 ; Is never true
ret int %E
}
+bool %test11(ubyte %A, ubyte %B) {
+ %C = sub ubyte %A, %B
+ %cD = setne ubyte %C, 0 ; == setne A, B
+ ret bool %cD
+}
%C = xor ubyte %B, 4 ; transform into an AND
ret ubyte %C
}
+
+bool %test12(ubyte %A) {
+ %B = xor ubyte %A, 4
+ %c = setne ubyte %B, 0
+ ret bool %c
+}