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

Quan Anh Mai duke at openjdk.org
Tue Sep 20 08:42:15 UTC 2022


On Sun, 18 Sep 2022 19:43:22 GMT, Quan Anh Mai <duke 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.

This pull request has now been integrated.

Changeset: a07902bc
Author:    Quan Anh Mai <anhmdq99 at gmail.com>
Committer: Jie Fu <jiefu at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/a07902bcbef066e0e63e1642082b56acadb71d93
Stats:     29 lines in 2 files changed: 0 ins; 0 del; 29 mod

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

Reviewed-by: kvn, jbhateja

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

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


More information about the hotspot-compiler-dev mailing list