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

Tim Northover t.p.northover at gmail.com
Fri Oct 24 06:27:04 PDT 2014


Hi again,

> I think it's harder to justify coming up
> with a single NewImm value by sign extending the existing immediate
> and giving up if that fails.

I've been doing some more thinking here, and if we're willing to
assume the truncation is to a power of two type (I am, anyone using
i14 deserves whatever they get) then I think we can cover *all* valid
cases by instead replicating the demanded bits across the 32-bit
register. E.g. try 0xfdfdfdfd instead of 0xfffffffd for the 8-bit
0xfd.

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.

Cheers.

Tim.



More information about the llvm-commits mailing list