[aarch64-port-dev ] RFR: 88158361: AArch64: Address calculation missed optimizations
Zhongwei Yao
zhongwei.yao at linaro.org
Mon Jun 19 10:23:06 UTC 2017
On 16 June 2017 at 21:39, Andrew Haley <aph at redhat.com> wrote:
> On 16/06/17 11:35, Zhongwei Yao wrote:
> > And there are 32 kinds of add/sub extension combination. I have tried to
> > add 18 rules in aarch64.ad, and found many of them are quite contrived,
> > like:
> > subw $dst, $src1, $src2, uxtb, #lshift //match rule: Set dst (SubI
> > src1 (LShiftI (AndI src2 mask) lshift)), where mask=255. java code: z =
> x -
> > ((y & 255) << lshift), where x, y, z are all int, lshift = [0, 4]
> > addw $dst, $src1, $src2, uxth, #lshift //match rule: Set dst (AddI
> > src1 (LShiftI (AndI src2 mask) lshift)), where mask=65535. java code: z
> = x
> > + ((y & 65535) << lshift), where x, y, z are all int, lshift = [0, 4]
> >
> > Shall I add all of these 18 rules?
>
> I would not want you to do anything you feel does not make sense. Please
> add
> the nodes that seem reasonable and that can be tested in code that C2
> generates.
>
I see. I will add most of the combinations except instructions like: add
x0, x1, x2, uxtx, # 1, which is replaced by add x0, x1, x2, lsl, #1.
> > And for the left 14 combination (as following), I have not come up rules
> to
> > utilise such instructions. Do you have any suggestion?
> > add SXTB (simplified for add rd, rm, rn, sxtb, #[0,4], same for
> below)
>
> Sign extension is modelled as Shift Left followed by Shift Right.
> SXTB is (RShiftL (LShiftL src 56) 56). You can figure out the rest from
> that.
>
Thanks for your suggestions!
> --
> Andrew Haley
> Java Platform Lead Engineer
> Red Hat UK Ltd. <https://www.redhat.com>
> EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
>
--
Best regards,
Zhongwei
More information about the aarch64-port-dev
mailing list