Bug 173471 - WebAssembly: implement non-trapping float to int conversion
Summary: WebAssembly: implement non-trapping float to int conversion
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
: 210300 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-06-16 08:53 PDT by JF Bastien
Modified: 2021-02-16 16:32 PST (History)
12 users (show)

See Also:


Attachments
WIP Patch (12.03 KB, patch)
2021-02-07 06:38 PST, Sergey Rubanov
no flags Details | Formatted Diff | Diff
WIP saturate float-to-int conversions (11.93 KB, patch)
2021-02-11 11:00 PST, Sergey Rubanov
no flags Details | Formatted Diff | Diff
Patch (302.43 KB, patch)
2021-02-16 05:52 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (302.16 KB, patch)
2021-02-16 06:01 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (302.42 KB, patch)
2021-02-16 06:09 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (300.01 KB, patch)
2021-02-16 06:12 PST, Yusuke Suzuki
no flags Details | Formatted Diff | Diff
Patch (300.03 KB, patch)
2021-02-16 07:09 PST, Yusuke Suzuki
tzagallo: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description JF Bastien 2017-06-16 08:53:49 PDT
As described here: https://github.com/WebAssembly/design/pull/1089

This is a post-MVP feature.
Comment 1 Darin Adler 2020-11-04 11:49:27 PST
*** Bug 210300 has been marked as a duplicate of this bug. ***
Comment 2 Sergey Rubanov 2021-02-07 06:38:49 PST
Created attachment 419538 [details]
WIP Patch
Comment 3 EWS Watchlist 2021-02-07 06:39:58 PST
This patch modifies one of the wasm.json files. Please ensure that any changes in one have been mirrored to the other. You can find the wasm.json files at "Source/JavaScriptCore/wasm/wasm.json" and "JSTests/wasm/wasm.json".
Comment 4 Sergey Rubanov 2021-02-11 11:00:12 PST
Created attachment 420006 [details]
WIP saturate float-to-int conversions
Comment 5 Yusuke Suzuki 2021-02-16 05:52:27 PST
Created attachment 420459 [details]
Patch
Comment 6 Yusuke Suzuki 2021-02-16 06:01:33 PST
Created attachment 420460 [details]
Patch
Comment 7 Yusuke Suzuki 2021-02-16 06:09:48 PST
Created attachment 420461 [details]
Patch
Comment 8 Yusuke Suzuki 2021-02-16 06:12:01 PST
Created attachment 420463 [details]
Patch
Comment 9 Yusuke Suzuki 2021-02-16 07:09:37 PST
Created attachment 420469 [details]
Patch
Comment 10 Tadeu Zagallo 2021-02-16 08:22:10 PST
Comment on attachment 420469 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=420469&action=review

r=me

> Source/JavaScriptCore/llint/WebAssembly.asm:1376
> +    move 0xcf000000, t0 # INT32_MIN (Note that INT32_MIN - 1.0 in float is the same as INT32_MIN in float).

why not use constexpr here?
Comment 11 Yusuke Suzuki 2021-02-16 13:27:36 PST
Comment on attachment 420469 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=420469&action=review

>> Source/JavaScriptCore/llint/WebAssembly.asm:1376
>> +    move 0xcf000000, t0 # INT32_MIN (Note that INT32_MIN - 1.0 in float is the same as INT32_MIN in float).
> 
> why not use constexpr here?

This is because we cannot use bitwise_cast / union in constexpr. This is bit pattern of float in INTT32_MIN.
Comment 12 Yusuke Suzuki 2021-02-16 15:30:53 PST
Committed r272933 (234166@main): <https://commits.webkit.org/234166@main>
Comment 13 Radar WebKit Bug Importer 2021-02-16 15:31:15 PST
<rdar://problem/74409614>