[aarch64-port-dev ] RFR: 88158361: AArch64: Address calculation missed optimizations

Andrew Haley aph at redhat.com
Fri Jun 16 13:39:46 UTC 2017


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.

> 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.

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the aarch64-port-dev mailing list