Bug 79617 - Implement support for op_negate and op_bitnot in the DFG JIT.
Summary: Implement support for op_negate and op_bitnot in the DFG JIT.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Gavin Barraclough
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-26 19:04 PST by Gavin Barraclough
Modified: 2012-02-27 16:32 PST (History)
3 users (show)

See Also:


Attachments
Fix (33.81 KB, patch)
2012-02-26 22:39 PST, Gavin Barraclough
no flags Details | Formatted Diff | Diff
Remove op_bitnot (25.17 KB, patch)
2012-02-27 10:18 PST, Gavin Barraclough
sam: review+
Details | Formatted Diff | Diff
ArithNegate (22.43 KB, patch)
2012-02-27 15:22 PST, Gavin Barraclough
fpizlo: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gavin Barraclough 2012-02-26 19:04:40 PST
To keep the IR simple, we can implement these as sub & xor operations.
Comment 1 Gavin Barraclough 2012-02-26 22:39:28 PST
Created attachment 128955 [details]
Fix
Comment 2 Gavin Barraclough 2012-02-26 23:25:05 PST
Gah, just finished testing, there is a bug here.  To implement negate as a subtract, it is -0.0 - X, rather than 0 - X, d'oh, should have remembered that.

Optimizing this would probably going to mean adding special cases for subtract-from-negative-zero throughout the code, so it's probably easier to just keep op_negate, and add support to the DFG JIT.

In the case of op_bitnot, removing this was a nice simplification so I'll probably stick with that approach.
Comment 3 Gavin Barraclough 2012-02-27 10:18:27 PST
Created attachment 129064 [details]
Remove op_bitnot
Comment 4 Sam Weinig 2012-02-27 10:22:40 PST
Comment on attachment 129064 [details]
Remove op_bitnot

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

> Source/JavaScriptCore/ChangeLog:8
> +        Remove op_bitnop รข this is redundant, ~x === x^-1.

Weird unicode character.

> Source/JavaScriptCore/ChangeLog:10
> +

Please put a comment about removing the canUse part of ResultType.
Comment 5 Gavin Barraclough 2012-02-27 10:26:49 PST
op_bitnot change landed in r109007.
Comment 6 Gavin Barraclough 2012-02-27 15:22:43 PST
Created attachment 129110 [details]
ArithNegate
Comment 7 Gavin Barraclough 2012-02-27 16:32:01 PST
Fixed in r109038.