[aarch64-port-dev ] RFR(S/M): 8247766: [aarch64] guarantee(val < (1U << nbits)) failed: Field too big for insn

Patric Hedlin patric.hedlin at oracle.com
Mon Jul 13 15:33:50 UTC 2020


Hi Andrew,

On 2020-07-09 16:26, Andrew Haley wrote:
> On 07/07/2020 12:17, Patric Hedlin wrote:
>> C1 code generation for reading and writing stack-slots does not handle
>> large immediate offsets on aarch64. This patch will ensure that
>> immediate offsets are admissible for base+(immediate)offset encoding or,
>> if this is not the case, will enforce an explicit address calculation to
>> a scratch register. (Also correcting a small glitch in 9-bit signed
>> immediate encoding check.)
>>
>> NOTE: Current patch includes (local) definitions of is_simm/9 and
>> is_uimm/12, for review purpose only. With JDK-8248901 these will move to
>> Assembler, and will not be included in the change-set.
> Umm, OK. These functions seem too complicated: all you have to do is
>
>      int64_t chk = val >> (nbits - 1);                                                                                                   |(gdb)
>      guarantee (chk == -1 || chk == 0, "Field too big for insn");                                                                        |#9  0x0000ffffbcab5c30 in Compilation::compile_method (this=0xffff80b7dde8)
The 'guarantee' of course works poorly as a predicate and the 'chk' 
calculation is based on implementation-dependent behaviour.

> but the AArch64 part of it looks fine.
Having seen your second answer, I guess you had a change of hart. What a 
pity.

/Patric


More information about the aarch64-port-dev mailing list