Bug 149254

Summary: Calling a float function on x86 in WebAssembly incorrectly returns a double
Product: WebKit Reporter: Sukolsak Sakshuwong <sukolsak>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, fpizlo, ggaren, mark.lam, msaboff, sukolsak
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 146064    
Attachments:
Description Flags
Patch none

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.