Closed
Bug 1244272
Opened 8 years ago
Closed 8 years ago
wasm: Implement a binary operator
Categories
(Core :: JavaScript Engine: JIT, defect)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
FIXED
mozilla47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: sunfish, Assigned: sunfish)
References
Details
Attachments
(3 files)
12.15 KB,
patch
|
luke
:
review+
|
Details | Diff | Splinter Review |
8.59 KB,
patch
|
luke
:
review+
|
Details | Diff | Splinter Review |
7.42 KB,
patch
|
luke
:
review+
|
Details | Diff | Splinter Review |
I'm starting with i32.add to start threading it through all the places that need it.
Assignee | ||
Comment 1•8 years ago
|
||
Attachment #8713797 -
Flags: review?(luke)
Assignee | ||
Comment 2•8 years ago
|
||
Building on the previous patch, here are the rest of the i32 binary operators (except comparisons).
Attachment #8713827 -
Flags: review?(luke)
Assignee | ||
Comment 3•8 years ago
|
||
And here are all the float binary opcodes except comparisons. min/max don't work yet because the implementation needs refactoring to deal with them not being variadic in wasm, and copysign doesn't have Ion support yet.
Attachment #8713831 -
Flags: review?(luke)
Comment 4•8 years ago
|
||
Comment on attachment 8713797 [details] [diff] [review] wasm-binary-operators.patch Review of attachment 8713797 [details] [diff] [review]: ----------------------------------------------------------------- Excellent. But don't you miss writing ML ;-) ? ::: js/src/asmjs/WasmText.cpp @@ +587,5 @@ > + return WasmToken(WasmToken::ValueType, ValType::F32, begin, cur_); > + > + switch (*cur_) { > + case 'c': > + if (consume(end_, MOZ_UTF16("const"))) Especially since perf doesn't matter, I probably should've done it the way you've done here, with 'switch (*cur_)' instead of 'switch (*cur_++)' so that way the MOZ_UTF16 strings can hold the full string instead of stripping the first character. Feel free to do that in this or a later patch or I will in some later patch. @@ +635,5 @@ > + return WasmToken(WasmToken::Const, ValType::I64, begin, cur_); > + break; > + } > + } else if (consume(end_, MOZ_UTF16("mport"))) { > + return WasmToken(WasmToken::Import, begin, cur_); For consistency with other cases, could you have each then-branch end in return/break so that way we can have a sequence of if{}if{}if{} instead of if{}else if{}else if {}?
Attachment #8713797 -
Flags: review?(luke) → review+
Comment 5•8 years ago
|
||
Comment on attachment 8713827 [details] [diff] [review] wasm-all-i32-binops.patch Review of attachment 8713827 [details] [diff] [review]: ----------------------------------------------------------------- weeeeeeeeeee
Attachment #8713827 -
Flags: review?(luke) → review+
Comment 6•8 years ago
|
||
Comment on attachment 8713831 [details] [diff] [review] wasm-float-binops.patch Review of attachment 8713831 [details] [diff] [review]: ----------------------------------------------------------------- Oh min/max.
Attachment #8713831 -
Flags: review?(luke) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/3baa9c161c1b https://hg.mozilla.org/integration/mozilla-inbound/rev/f1721ff79abc https://hg.mozilla.org/integration/mozilla-inbound/rev/fe865d5d95dc
Assignee | ||
Comment 8•8 years ago
|
||
> For consistency with other cases, could you have each then-branch end in return/break so that way we can have a sequence of if{}if{}if{} instead of if{}else if{}else if {}?
Done.
Comment 9•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/3baa9c161c1b https://hg.mozilla.org/mozilla-central/rev/f1721ff79abc https://hg.mozilla.org/mozilla-central/rev/fe865d5d95dc
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox47:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in
before you can comment on or make changes to this bug.
Description
•