Bug 165252 - Add wasm int to floating point opcodes
Summary: Add wasm int to floating point opcodes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keith Miller
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-01 05:28 PST by Keith Miller
Modified: 2016-12-01 14:00 PST (History)
5 users (show)

See Also:


Attachments
Patch (27.78 KB, patch)
2016-12-01 06:34 PST, Keith Miller
no flags Details | Formatted Diff | Diff
Patch (27.87 KB, patch)
2016-12-01 10:21 PST, Keith Miller
no flags Details | Formatted Diff | Diff
Patch (27.86 KB, patch)
2016-12-01 10:50 PST, Keith Miller
no flags Details | Formatted Diff | Diff
Patch for landing (27.85 KB, patch)
2016-12-01 13:24 PST, Keith Miller
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Miller 2016-12-01 05:28:06 PST
Add wasm int to floating point opcodes
Comment 1 Keith Miller 2016-12-01 06:34:25 PST
Created attachment 295846 [details]
Patch
Comment 2 Keith Miller 2016-12-01 10:21:17 PST
Created attachment 295859 [details]
Patch
Comment 3 Geoffrey Garen 2016-12-01 10:43:59 PST
Comment on attachment 295859 [details]
Patch

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

r=me

> Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h:1314
> +        AssemblerLabel signedBitSet = m_assembler.jCC(x86Condition(Signed));

It's "sign bit" not "signed bit".

> Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h:1334
> +        AssemblerLabel signedBitSet = m_assembler.jCC(x86Condition(Signed));

Ditto.
Comment 4 Geoffrey Garen 2016-12-01 10:50:00 PST
The clang code for this looks slightly better, and would eliminate the need for a scratch register API difference between platforms:

0000000100000f69	punpckldq	0x1f(%rip), %xmm0
0000000100000f71	subpd	0x27(%rip), %xmm0
0000000100000f79	haddpd	%xmm0, %xmm0

I think this is a 128bit "subtract 1 and then double". We can mimic the same with constant operands, since we prefer to avoid introducing globals in the macro assembler.
Comment 5 Keith Miller 2016-12-01 10:50:47 PST
Created attachment 295866 [details]
Patch
Comment 6 WebKit Commit Bot 2016-12-01 10:52:45 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 7 Keith Miller 2016-12-01 13:24:25 PST
Created attachment 295885 [details]
Patch for landing
Comment 8 WebKit Commit Bot 2016-12-01 14:00:44 PST
Comment on attachment 295885 [details]
Patch for landing

Clearing flags on attachment: 295885

Committed r209204: <http://trac.webkit.org/changeset/209204>
Comment 9 WebKit Commit Bot 2016-12-01 14:00:48 PST
All reviewed patches have been landed.  Closing bug.