Bug 152425

Summary: [JSC] Add EqualOrUnordered to B3
Product: WebKit Reporter: Benjamin Poulain <benjamin>
Component: New BugsAssignee: Benjamin Poulain <benjamin>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, fpizlo, ggaren, keith_miller, mark.lam, msaboff, saam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 150279    
Attachments:
Description Flags
Patch
none
Patch for landing none

Benjamin Poulain
Reported 2015-12-18 06:58:20 PST
[JSC] Add EqualOrUnordered to B3
Attachments
Patch (27.13 KB, patch)
2015-12-18 06:59 PST, Benjamin Poulain
no flags
Patch for landing (27.28 KB, patch)
2015-12-19 07:53 PST, Benjamin Poulain
no flags
Benjamin Poulain
Comment 1 2015-12-18 06:59:24 PST
Mark Lam
Comment 2 2015-12-18 09:33:39 PST
Comment on attachment 267626 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=267626&action=review > Source/JavaScriptCore/b3/B3LowerToAir.cpp:1158 > + return createRelCond(MacroAssembler::BelowOrEqual, MacroAssembler::DoubleEqualOrUnordered); Why is the first condition "MacroAssembler::BelowOrEqual" instead of "MacroAssembler::Equal"? Or is this a bogus condition because this condition only applies to doubles? If so, can we have a comment here similar to the one in "case Above:" below. Ideally, an assertion that (value->child(0)->type() == Float) would be good if this path is not to be taken for ints. Adding an analogous assertion (ensuring children are Int typed) for Above, Below, AboveEqual, BelowEqual would be good too (but can be done in a separate patch). LGTM otherwise.
Mark Lam
Comment 3 2015-12-18 09:46:04 PST
Comment on attachment 267626 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=267626&action=review >> Source/JavaScriptCore/b3/B3LowerToAir.cpp:1158 >> + return createRelCond(MacroAssembler::BelowOrEqual, MacroAssembler::DoubleEqualOrUnordered); > > Why is the first condition "MacroAssembler::BelowOrEqual" instead of "MacroAssembler::Equal"? Or is this a bogus condition because this condition only applies to doubles? If so, can we have a comment here similar to the one in "case Above:" below. Ideally, an assertion that (value->child(0)->type() == Float) would be good if this path is not to be taken for ints. Adding an analogous assertion (ensuring children are Int typed) for Above, Below, AboveEqual, BelowEqual would be good too (but can be done in a separate patch). > > LGTM otherwise. Spoke with Ben offline. r=me with fixes.
Filip Pizlo
Comment 4 2015-12-18 09:52:48 PST
Comment on attachment 267626 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=267626&action=review Please change the name of the constant folding method. > Source/JavaScriptCore/b3/B3ConstDoubleValue.cpp:161 > +TriState ConstDoubleValue::equalOrUnordered(const Value* other) const This should be called equalOrUnorderedConstant
Filip Pizlo
Comment 5 2015-12-18 10:51:34 PST
*** Bug 152358 has been marked as a duplicate of this bug. ***
Filip Pizlo
Comment 6 2015-12-18 10:56:55 PST
Comment on attachment 267626 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=267626&action=review Revoking r+ because there are a couple of things that need to be changed before this lands. > Source/JavaScriptCore/b3/B3ReduceDoubleToFloat.cpp:109 > + case EqualOrUnordered: You also need a case for EqualOrUnordered in the main switch statement in B3::LowerToAir::lower().
Filip Pizlo
Comment 7 2015-12-18 18:32:05 PST
(In reply to comment #6) > Comment on attachment 267626 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=267626&action=review > > Revoking r+ because there are a couple of things that need to be changed > before this lands. > > > Source/JavaScriptCore/b3/B3ReduceDoubleToFloat.cpp:109 > > + case EqualOrUnordered: > > You also need a case for EqualOrUnordered in the main switch statement in > B3::LowerToAir::lower(). Hmmm, I guess you don't have to do this in this patch since I guess it triggers https://bugs.webkit.org/show_bug.cgi?id=150903. Up to you.
Filip Pizlo
Comment 8 2015-12-18 18:32:48 PST
Comment on attachment 267626 [details] Patch Flipping back to r+ but please rename Value::equalOrUnordered to Value::equalOrUnorderedConstant to match the other constant-folding method names.
Benjamin Poulain
Comment 9 2015-12-19 00:14:52 PST
(In reply to comment #8) > Comment on attachment 267626 [details] > Patch > > Flipping back to r+ but please rename Value::equalOrUnordered to > Value::equalOrUnorderedConstant to match the other constant-folding method > names. Value::equalOrUnordered() also handle single unordered arg, that's why it does not have the "Constant" suffix. Do you still require that renaming?
Filip Pizlo
Comment 10 2015-12-19 06:52:13 PST
(In reply to comment #9) > (In reply to comment #8) > > Comment on attachment 267626 [details] > > Patch > > > > Flipping back to r+ but please rename Value::equalOrUnordered to > > Value::equalOrUnorderedConstant to match the other constant-folding method > > names. > > Value::equalOrUnordered() also handle single unordered arg, that's why it > does not have the "Constant" suffix. > > Do you still require that renaming? Good point. But the normal Equal method could always return false if 'this' is nan no matter whether the other argument is a constant. So I think we use the "Constant" in the method name to signify that this is a constant folding helper. Better to stick with that.
Benjamin Poulain
Comment 11 2015-12-19 07:53:42 PST
Created attachment 267686 [details] Patch for landing
WebKit Commit Bot
Comment 12 2015-12-19 08:52:38 PST
Comment on attachment 267686 [details] Patch for landing Clearing flags on attachment: 267686 Committed r194314: <http://trac.webkit.org/changeset/194314>
WebKit Commit Bot
Comment 13 2015-12-19 08:52:42 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.