[PATCH] AArch64: Fold immediate into the immediate field of logical instructions

Akira Hatanaka ahatanak at gmail.com
Fri Oct 24 11:26:09 PDT 2014


>>! In D5591#15, @t.p.northover wrote:
> The argument goes that if the input is morally contiguous, then there
> are multiple representations involving sign extension to 4, 8, 16 or
> 32 followed by replication. Otherwise the replication width is less
> than the demanded width so we're completely forced and have to
> continue the replication that's already started.
> 

Sign-extension followed by replication enables converting constants like 0xfdfd (demanded = 16-bits) or 0x3dfd (demanded = 14bits) to bimm, where just sign-extending fails, but I think we should also try to handle cases like 0x19 (demanded = 5bits).  This isn't a bimm as it stands and sign-extending doesn't make it a bimm either. In this case, we have to copy bits 1-3 to bits 5-7.

I think I can come up with a patch that does this.

http://reviews.llvm.org/D5591






More information about the llvm-commits mailing list