On Thu, 3 Sep 2026 06:32:02 GMT, Dean Long <[email protected]> wrote:
>> Quan Anh Mai has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains six commits: >> >> - Merge branch 'master' into int128 >> - C++17 >> - Merge branch 'master' into int128 >> - Merge branch 'master' into int128 >> - whitespace >> - Implement Int128T addsub > > src/hotspot/share/opto/macro.cpp line 3197: > >> 3195: Node* overflow_cmp = _igvn.transform(new CmpULNode(is_add ? new_lo >> : addsub->lo1(), addsub->lo2())); >> 3196: Node* overflow_bol = _igvn.transform(new BoolNode(overflow_cmp, >> BoolTest::lt)); >> 3197: Node* overflow_int = _igvn.transform(new CMoveLNode(overflow_bol, >> _igvn.longcon(0), _igvn.longcon(1), TypeLong::LONG)); > > Isn't cmove the best choice only when the condition is unpredictable? > Overflow should be rare, so a predicted branch seems better. On second thought, if the values are sufficiently large, and not just 128-bit versions of 32- and 64-bit numbers, then I guess overflow could be unpredictable. But maybe we shouldn't assume that but instead let profiling decide. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/31008#discussion_r3921784313
