Bug 149102 - Implement the arithmetic instructions for floats in WebAssembly
Summary: Implement the arithmetic instructions for floats in WebAssembly
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-13 01:26 PDT by Sukolsak Sakshuwong
Modified: 2015-09-14 11:30 PDT (History)
8 users (show)

See Also:


Attachments
Patch (16.06 KB, patch)
2015-09-14 00:10 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-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.