From b8509c6273a189321a4b6c01b5550a71b079569a Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Tue, 23 Aug 2016 14:42:03 -0700 Subject: [PATCH] Add bitwise operations with an immediate operand. --- meta/cretonne/base.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/meta/cretonne/base.py b/meta/cretonne/base.py index 2dd3c1bf95..30d890b076 100644 --- a/meta/cretonne/base.py +++ b/meta/cretonne/base.py @@ -442,6 +442,29 @@ bnot = Instruction( """, ins=x, outs=a) +# Bitwise binary ops with immediate arg. +x = Operand('x', iB) +Y = Operand('Y', imm64) +a = Operand('a', iB) + +band_imm = Instruction( + 'band_imm', """ + Bitwise and with immediate. + """, + ins=(x, Y), outs=a) + +bor_imm = Instruction( + 'bor_imm', """ + Bitwise or with immediate. + """, + ins=(x, Y), outs=a) + +bxor_imm = Instruction( + 'bxor_imm', """ + Bitwise xor with immediate. + """, + ins=(x, Y), outs=a) + # Shift/rotate. x = Operand('x', Int, doc='Scalar or vector value to shift') y = Operand('y', iB, doc='Number of bits to shift')