Sub-word comparisons

Tom Rodriguez tom.rodriguez at oracle.com
Thu Nov 3 19:49:45 UTC 2016


> On Nov 3, 2016, at 12:24 PM, Andrew Haley <aph at redhat.com> wrote:
> 
> On 03/11/16 19:18, Doug Simon wrote:
> 
>> The lowering of a CompareNode to a CompareOp is AArch64 specific as
>> far as I can see. This originates from the AArch64 implementations
>> of LIRGenerator.emitCompareBranch and
>> LIRGenerator.emitConditionalMove. You’ll have to change those
>> methods to generate LIR ops that AArch64 actually supports.
> 
> Oh sure, I can do that, but that wasn't my problem, it was how to stop
> Graal from creating sub-word comparisons in the first place.  Such
> operations aren't part of the JVM at all, but are generated when the
> bytecode is canonicalized.  I can generate code for sub-word
> comparisons, but it won't be good code.  AArch64 is designed to work
> well for languages like C and Java, which don't have any arithmetic
> operations on sub-word types.

I think SPARC has the same restrictions so it should be possible to make it work.  Can find you find the equivalent path in the SPARC sources?  For instance I can see that com.oracle.graal.compiler.sparc.SPARCLIRGenerator.emitCompareBranch asserts that the actual compares are with WORD or XWORD which is 4 or 8 bytes respectively.

Roland might be able to give a better answer for this.  I thought we’d stamped out the sub word operations are while back.

tom


More information about the graal-dev mailing list