bitwise operator support webrev
Venkatachalam, Vasanth
Vasanth.Venkatachalam at amd.com
Fri Oct 18 08:39:42 PDT 2013
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