Implemented b{and,or,xor}_not bitops for ty_int_ref_scalar_64 type. (#5604)
* Implemented `b{and,or,xor}_not` bitops for ty_int_ref_scalar_64 type.
* Added tests.
This commit is contained in:
@@ -35,3 +35,34 @@ block0(v0: i64):
|
||||
}
|
||||
; run: %bnot_i64(0) == -1
|
||||
; run: %bnot_i64(1) == -2
|
||||
|
||||
|
||||
function %band_not(i8, i8) -> i8 {
|
||||
block0(v0: i8, v1: i8):
|
||||
v2 = band_not.i8 v0, v1
|
||||
return v2
|
||||
}
|
||||
|
||||
; run: %band_not(0xFF, 0) == -1
|
||||
; run: %band_not(0x55, 0xFF) == 0
|
||||
; run: %band_not(0, 0) == 0
|
||||
|
||||
function %bor_not(i8, i8) -> i8 {
|
||||
block0(v0: i8, v1: i8):
|
||||
v2 = bor_not.i8 v0, v1
|
||||
return v2
|
||||
}
|
||||
|
||||
; run: %bor_not(0xFF, 0) == -1
|
||||
; run: %bor_not(0x55, 0xFF) == 85
|
||||
; run: %bor_not(0, 0) == -1
|
||||
|
||||
function %bxor_not(i8, i8) -> i8 {
|
||||
block0(v0: i8, v1: i8):
|
||||
v2 = bxor_not.i8 v0, v1
|
||||
return v2
|
||||
}
|
||||
|
||||
; run: %bxor_not(0xFF, 0) == 0
|
||||
; run: %bxor_not(0x55, 0xFF) == 85
|
||||
; run: %bxor_not(0, 0) == -1
|
||||
Reference in New Issue
Block a user