Bug 149102

Summary: Implement the arithmetic instructions for floats in WebAssembly
Product: WebKit Reporter: Sukolsak Sakshuwong <sukolsak>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, commit-queue, fpizlo, ggaren, mark.lam, sbarati, sukolsak, ysuzuki
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-13 01:26:14 PDT
Implement the arithmetic instructions for floats (float32) in WebAssembly.
Comment 1 Sukolsak Sakshuwong 2015-09-14 00:10:32 PDT
Created attachment 261106 [details]
Patch
Comment 2 WebKit Commit Bot 2015-09-14 00:13:31 PDT
Attachment 261106 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/wasm/WASMFunctionCompiler.h:844:  JIT_OPERATION is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 1 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Geoffrey Garen 2015-09-14 10:42:04 PDT
Comment on attachment 261106 [details]
Patch

These conversions are pretty expensive. Why not just do the math as float?
Comment 4 Sukolsak Sakshuwong 2015-09-14 11:19:56 PDT
Thanks for the review.

(In reply to comment #3)
> Comment on attachment 261106 [details]
> Patch
> 
> These conversions are pretty expensive. Why not just do the math as float?

Our macro assembler currently doesn't have any float arithmetic instructions. I could add them for x86, x86-64, and ARM. But I am not sure how to add and test them on MIPS and SH4. Is it OK if I just add them for x86, x86-64, and ARM and do something like

#if CPU(X86) || CPU(X86_64)
    m_assembler.addsd_rr(...);
#elif CPU(ARM) || CPU(ARM64) 
    m_assembler....(...);
#else
    convertFloatToDouble(FPRInfo::fpRegT0, FPRInfo::fpRegT0);
    addDouble(FPRInfo::fpRegT1, FPRInfo::fpRegT0);
    convertDoubleToFloat(FPRInfo::fpRegT0, FPRInfo::fpRegT0);
#endif

?
Comment 5 WebKit Commit Bot 2015-09-14 11:30:21 PDT
Comment on attachment 261106 [details]
Patch

Clearing flags on attachment: 261106

Committed r189744: <http://trac.webkit.org/changeset/189744>
Comment 6 WebKit Commit Bot 2015-09-14 11:30:25 PDT
All reviewed patches have been landed.  Closing bug.