On Sat, 26 Feb 2022 03:37:32 GMT, Quan Anh Mai <d...@openjdk.java.net> wrote:
>> Clarification, the number in my comments above is (2^w - 1). This is from >> Intel SDM >> (https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html). >> Also you will need to take care when the valid unoverflowed result is -1 >> i.e. 0xFFFFFFFF (2^32 - 1). > > I believe the indefinite value should be 2^(w - 1) (a.k.a 0x80000000) and the > documentation is typoed. If you look at `cvtss2si`, the indefinite value is > also written as 2^w - 1 but yet in `MacroAssembler::convert_f2i` we compare > it with 0x80000000. In addition, choosing -1 as an indefinite value is weird > enough and to complicate it as 2^w - 1 is really unusual. `MacroAssembler::convert_f2i` https://github.com/openjdk/jdk/blob/c5c6058fd57d4b594012035eaf18a57257f4ad85/src/hotspot/cpu/x86/macroAssembler_x86.cpp#L8919 ------------- PR: https://git.openjdk.java.net/jdk/pull/7094