Add bitwise ops that invert the second operand.
ARM has all of these as scalar integer instructions. Intel has band_not in SSE and as a scalar in BMI1. Add the trivial legalization patterns that use a bnot instruction.
This commit is contained in:
@@ -667,11 +667,9 @@ operating on boolean values, the bitwise operations work as logical operators.
|
||||
.. autoinst:: bxor
|
||||
.. autoinst:: bxor_imm
|
||||
.. autoinst:: bnot
|
||||
|
||||
.. todo:: Redundant bitwise operators.
|
||||
|
||||
ARM has instructions like ``bic(x,y) = x & ~y``, ``orn(x,y) = x | ~y``, and
|
||||
``eon(x,y) = x ^ ~y``.
|
||||
.. autoinst:: band_not
|
||||
.. autoinst:: bor_not
|
||||
.. autoinst:: bxor_not
|
||||
|
||||
The shift and rotate operations only work on integer types (scalar and vector).
|
||||
The shift amount does not have to be the same type as the value being shifted.
|
||||
|
||||
@@ -28,3 +28,11 @@ ebb0(v0: i32):
|
||||
; check: $(cst=$V) = iconst.i32 0x3b9a_ca00
|
||||
; check: $v1 = iadd $v0, $cst
|
||||
; check: return $v1
|
||||
|
||||
function %bitclear(i32, i32) -> i32 {
|
||||
ebb0(v0: i32, v1: i32):
|
||||
v2 = band_not v0, v1
|
||||
; check: bnot
|
||||
; check: band
|
||||
return v2
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user