Bug 149254 - Calling a float function on x86 in WebAssembly incorrectly returns a double
Summary: Calling a float function on x86 in WebAssembly incorrectly returns a double
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 146064
  Show dependency treegraph
 
Reported: 2015-09-17 02:08 PDT by Sukolsak Sakshuwong
Modified: 2015-09-17 10:40 PDT (History)
6 users (show)

See Also:


Attachments
Patch (5.67 KB, patch)
2015-09-17 02:16 PDT, Sukolsak Sakshuwong
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sukolsak Sakshuwong 2015-09-17 02:08:30 PDT
In WebAssembly on x86 (32-bit), when we call a function that returns a float or a double, we use the FSTP instruction to read the return value from the FPU register stack. The FSTP instruction converts the value to single-precision or double-precision floating-point format, depending on the destination operand. Currently, we always use double as the destination. This is wrong. We should use the correct type.
Comment 1 Sukolsak Sakshuwong 2015-09-17 02:16:07 PDT
Created attachment 261380 [details]
Patch
Comment 2 Michael Saboff 2015-09-17 08:01:27 PDT
Comment on attachment 261380 [details]
Patch

r=me
Comment 3 WebKit Commit Bot 2015-09-17 10:40:23 PDT
Comment on attachment 261380 [details]
Patch

Clearing flags on attachment: 261380

Committed r189918: <http://trac.webkit.org/changeset/189918>
Comment 4 WebKit Commit Bot 2015-09-17 10:40:27 PDT
All reviewed patches have been landed.  Closing bug.