bitwise operator support webrev

Christian Thalinger christian.thalinger at oracle.com
Fri Oct 18 09:11:52 PDT 2013


graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILArithmetic.java:

Could you remove the // @formatter:off in that file so we get proper formatting?  Or at least turn it on after the enum values.

You should also fix the copyright years in you new test files:

   2  * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.

Use "2013, ".

Otherwise this looks good.

On Oct 18, 2013, at 8:39 AM, "Venkatachalam, Vasanth" <Vasanth.Venkatachalam at amd.com> wrote:

> Hi,
> 
> I've uploaded a webrev that extends the HSAIL backend to generate code for three of the bitwise logical operators AND, OR and XOR.
> 
> http://cr.openjdk.java.net/~tdeneau/bitwiseopsupport.03/webrev/
> 
> Please review and provide feedback.
> 
> Summary:
> 
> The main changes are in HSAILLIRGenerator, where I implemented the routines emitOr and emitXor which were previously throwing NYIs, and in HSAiLAssembler, where I added a routine, emitBitwiseLogical. I've added test cases to test these bitwise operations on all the primitive types that they support. There are two variants of each test case, one which casts the result of the bitwise operation to the original data type that was being operated on (e.g., byte, char, short) and another which simply returns the default return type which is an int.
> 
> To support the cast operation that the new tests exercise I also had to enhance the emitConvert( ) routine in HSAILLiRGenerator to handle additional types of conversions which weren't previously supported.  In particular, I2S, I2C and I2B required special handling since Graal was returning an int for the destination. This required me to refactor the emitConvert routine in the assembler into multiple routines. I've also added additional test cases to exercise the different conversion types that this webrev adds support for.
> 
> Vasanth
> 
> 



More information about the graal-dev mailing list