RFR: 8293976: Use unsigned integers in Assembler/CodeBuffer::emit_int*

Jatin Bhateja jbhateja at openjdk.org
Tue Sep 20 01:04:39 UTC 2022


On Mon, 19 Sep 2022 14:26:32 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

>> Assembler/CodeBuffer::emit_int* accept signed int arguments.
>> 
>> - Since we are trying to emit some bit patterns into the code buffer instead of doing integer arithmetics, it makes more sense to use unsigned parameters.
>> 
>> - It makes usage with constants become inconvenient, as an integer literal is positive, a 0xC0 does not fit into an int8_t, resulting in the compiler complaining about lossy implicit conversions, the current solution is manual casting of the constants to unsigned char, which can be converted to int8_t without complaints.
>> 
>> Please have a look and leave some reviews. Thanks very much.
>
> Do you also plan to cleanup redundant char casting usages from assembler after your modifications.

> @jatin-bhateja Thanks for taking a look, those redundant casts do not have any drawbacks so I think existing usages could stay as they are.

Fine.

-------------

PR: https://git.openjdk.org/jdk/pull/10325


More information about the hotspot-compiler-dev mailing list