Bug 232644 - [JSC] Add LLInt fast path for OpMod on x86_64
Summary: [JSC] Add LLInt fast path for OpMod on x86_64
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: Ross Kirsling
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-11-02 15:21 PDT by Ross Kirsling
Modified: 2021-11-02 20:24 PDT (History)
8 users (show)

See Also:


Attachments
Patch (4.80 KB, patch)
2021-11-02 15:30 PDT, Ross Kirsling
no flags Details | Formatted Diff | Diff
Patch for landing (5.56 KB, patch)
2021-11-02 18:16 PDT, Ross Kirsling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ross Kirsling 2021-11-02 15:21:51 PDT
[JSC] Add LLInt fast path for OpMod on x86_64
Comment 1 Ross Kirsling 2021-11-02 15:30:29 PDT
Created attachment 443140 [details]
Patch
Comment 2 Saam Barati 2021-11-02 16:16:23 PDT
Comment on attachment 443140 [details]
Patch

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

r=me

> Source/JavaScriptCore/llint/LowLevelInterpreter64.asm:1294
> +        loadConstantOrVariable(size, t0, t1)
> +        loadConstantOrVariable(size, t2, t0)
> +        bqb t0, numberTag, .slow
> +        bqb t1, numberTag, .slow

Maybe loadConstantOrVariableInt32?
Comment 3 Yusuke Suzuki 2021-11-02 16:22:17 PDT
Comment on attachment 443140 [details]
Patch

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

r=me too

> Source/JavaScriptCore/llint/LowLevelInterpreter64.asm:1306
> +        # Assume t3 is scratchable.
> +        move t1, t3
> +        move t0, t0
> +        cdqi
> +        idivi t3
> +        bigteq t0, 0, .notNegZero
> +        btiz r1, .slow

Let's add static_assert with GPRInfo::regTX to ensure that these registers are specific ones. (e.g. regT0 should be eax, and let's comment about r1 is always edx.)
Comment 4 Ross Kirsling 2021-11-02 18:16:46 PDT
Created attachment 443155 [details]
Patch for landing
Comment 5 EWS 2021-11-02 20:24:00 PDT
Committed r285197 (243823@main): <https://commits.webkit.org/243823@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 443155 [details].
Comment 6 Radar WebKit Bug Importer 2021-11-02 20:24:17 PDT
<rdar://problem/84959127>