Bug 164743 - Add Wasm select
Summary: Add Wasm select
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-11-14 15:56 PST by Keith Miller
Modified: 2016-11-14 17:13 PST (History)
5 users (show)

See Also:


Attachments
Patch (7.61 KB, patch)
2016-11-14 16:14 PST, Keith Miller
no flags Details | Formatted Diff | Diff
Patch (7.55 KB, patch)
2016-11-14 16:19 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-11-14 15:56:32 PST
Add Wasm select
Comment 1 Keith Miller 2016-11-14 16:14:25 PST
Created attachment 294771 [details]
Patch
Comment 2 Keith Miller 2016-11-14 16:19:09 PST
Created attachment 294773 [details]
Patch
Comment 3 JF Bastien 2016-11-14 16:28:47 PST
Comment on attachment 294773 [details]
Patch

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

> Source/JavaScriptCore/wasm/WasmFunctionParser.h:202
> +        if (!popExpressionStack(condition))

This is last:

select: a ternary operator with two operands, which have the same type as each other, plus a boolean (i32) condition. select returns the first operand if the condition operand is non-zero, or the second otherwise.

I think the values are inverted as well.
Comment 5 JF Bastien 2016-11-14 16:49:08 PST
(In reply to comment #4)
> Changed here: https://github.com/WebAssembly/design/pull/489
> Spec:
> https://github.com/WebAssembly/spec/commit/
> 43c87e32262d00aad59d771711b32145396fb0b1

Ignore me, I can't do stack growth directions.
Comment 6 Keith Miller 2016-11-14 16:49:31 PST
(In reply to comment #3)
> Comment on attachment 294773 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=294773&action=review
> 
> > Source/JavaScriptCore/wasm/WasmFunctionParser.h:202
> > +        if (!popExpressionStack(condition))
> 
> This is last:
> 
> select: a ternary operator with two operands, which have the same type as
> each other, plus a boolean (i32) condition. select returns the first operand
> if the condition operand is non-zero, or the second otherwise.
> 
> I think the values are inverted as well.

I think it's right the condition is the last thing pushed to the stack and so it's the first thing popped off the stack in select.
Comment 7 WebKit Commit Bot 2016-11-14 17:13:54 PST
Comment on attachment 294773 [details]
Patch

Clearing flags on attachment: 294773

Committed r208719: <http://trac.webkit.org/changeset/208719>
Comment 8 WebKit Commit Bot 2016-11-14 17:13:58 PST
All reviewed patches have been landed.  Closing bug.