RFR: 8344304: [s390x] ubsan: negation of -2147483648 cannot be represented in type 'int' [v5]

Amit Kumar amitkumar at openjdk.org
Tue Dec 3 12:08:39 UTC 2024


On Tue, 3 Dec 2024 11:55:53 GMT, Dean Long <dlong at openjdk.org> wrote:

>> Amit Kumar has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   make similar to add2reg
>
> src/hotspot/cpu/s390/macroAssembler_s390.hpp line 160:
> 
>> 158:   // Generic operation r1 := r2 + imm.
>> 159:   void add2reg   (Register r1, int64_t imm, Register r2 = noreg);
>> 160:   void add2reg_32(Register r1, int64_t imm, Register r2 = noreg);
> 
> I don't understand the difference between these two.  For both, imm must be a simm_32.  I don't think we need add2reg_32.

for `add2reg_32` the sum and the first operand, register in this case, are treated as 32 bits signed integers. But for `add2reg`, sum and  operands will be treated as `64 bits` signed integers.  Immediate value in both case will be 32 bits only.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22456#discussion_r1867599419


More information about the hotspot-compiler-dev mailing list