[PATCH] AArch64: Implement common instruction aliases
James Molloy
james.molloy at arm.com
Wed Mar 26 06:55:38 PDT 2014
Hi Tim,
The attached patches provide instruction aliases for negated or complemented
immediates. The logicalimm patch implements:
BIC Rd, Rn, #imm -> AND Rd, Rn, #~imm
And similarly for ORN, EON and BICS.
The addsubimm patch implements:
ADD Rd, Rn, #imm (imm < 0) -> SUB Rd, Rn, #-imm
And similarly for SUB, ADDS, SUBS and CMP.
This is my first patch to the MC layer in quite a while so please don't
assume I have any competence in this area when reviewing J
In particular, I don't know quite what to do about:
def _posimm_neg_lsl12 : Operand<ty>,
ImmLeaf<ty, [{ return Imm >= 0 && (Imm & ~0xfff000) == 0; }],
shr_12_XFORM>;
The ImmLeaf was basically copied from the non-negated operand variant, but
as this operand type is never going to be used for instruction selection
(It's for passing to an InstAlias only), I'm not sure if (a) I need an
ImmLeaf or PatLeaf at all or (b) if I do,if the predicate should just
"return false;". Advice here would be really useful.
Cheers,
James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140326/7e97227c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: alias-addsubimm.diff
Type: application/octet-stream
Size: 18992 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140326/7e97227c/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: alias-logicalimm.diff
Type: application/octet-stream
Size: 5561 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140326/7e97227c/attachment-0001.obj>
More information about the llvm-commits
mailing list