[aarch64-port-dev ] RFR: 8221658: aarch64: add necessary predicate for ubfx patterns

Yangfei (Felix) felix.yang at huawei.com
Thu Apr 4 02:08:42 UTC 2019


Comments inlined:

> On 4/3/19 2:15 AM, Yangfei (Felix) wrote:
> > Updated webrev: http://cr.openjdk.java.net/~fyang/8221658/webrev.01
> > Is this one better?
> 
> It still doesn't look quite right. According to the Java Language Standard,
> shifts are all taken mod 32 or mod 64. Therefore, it is not possible for
> the shift size to be out of range, surely?
    I haven't looked into the details about how this is ensured in the JVM, but it deserves a look.
    One thing I noticed is that the jdk13 arm port also used a ' immU5 ' match operand as a shift:

 1761 // Valid scale values for addressing modes and shifts
 1762 operand immU5() %{
 1763   predicate(0 <= n->get_int() && (n->get_int() <= 31));
 1764   match(ConI);
 1765   op_cost(0);
 1766
 1767   format %{ %}
 1768   interface(CONST_INTER);
 1769 %}

 ......

 5334 instruct addshrI_reg_imm_reg(iRegI dst, iRegI src1, immU5 src2, iRegI src3) %{
 5335   match(Set dst (AddI (URShiftI src1 src2) src3));
 5336
 5337   size(4);
 5338   format %{ "add_32 $dst,$src3,$src1>>>$src2\t! int" %}
 5339   ins_encode %{
 5340     __ add_32($dst$$Register, $src3$$Register, AsmOperand($src1$$Register, lsr, $src2$$constant));
 5341   %}
 5342   ins_pipe(ialu_reg_reg);
 5343 %}

> Have you got a reproducer for this failure that I can see?
    I have put the fuzz test case and call trace on the JBS:
    https://bugs.openjdk.java.net/secure/attachment/81950/fuzz-test.tar.bz2
    Command line: $ java Start
    I can always reproduce the crash with a fastdebug or slowdebug jdk built from the latest aarch64 jdk8u-shenandoah repo.

Thanks,
Felix


More information about the aarch64-port-dev mailing list