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:
Jakob Stoklund Olesen
2017-07-20 11:14:11 -07:00
parent 014d9a14fe
commit 6ba604125d
4 changed files with 48 additions and 5 deletions

View File

@@ -920,6 +920,30 @@ bnot = Instruction(
""",
ins=x, outs=a)
band_not = Instruction(
'band_not', """
Bitwise and not.
Computes `x & ~y`.
""",
ins=(x, y), outs=a)
bor_not = Instruction(
'bor_not', """
Bitwise or not.
Computes `x | ~y`.
""",
ins=(x, y), outs=a)
bxor_not = Instruction(
'bxor_not', """
Bitwise xor not.
Computes `x ^ ~y`.
""",
ins=(x, y), outs=a)
# Bitwise binary ops with immediate arg.
x = Operand('x', iB)
Y = Operand('Y', imm64)