Bug 152232 - [JSC] Add signExtend8To64 / signExtend16To64
Summary: [JSC] Add signExtend8To64 / signExtend16To64
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks: 154319
  Show dependency treegraph
 
Reported: 2015-12-13 15:18 PST by Filip Pizlo
Modified: 2023-03-14 16:54 PDT (History)
10 users (show)

See Also:


Attachments
WIP (12.91 KB, patch)
2020-11-30 16:51 PST, Sergey Rubanov
no flags Details | Formatted Diff | Diff
WIP (14.65 KB, patch)
2021-12-25 21:23 PST, Sergey Rubanov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2015-12-13 15:18:32 PST
Currently we do the two sign extensions separately.
Comment 1 Sergey Rubanov 2020-11-30 16:51:51 PST
Created attachment 415079 [details]
WIP
Comment 2 Yusuke Suzuki 2020-11-30 16:57:13 PST
Comment on attachment 415079 [details]
WIP

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

Some early comments. Nice.
And I recommend adding tests to testair / testb3 when modifying Air / B3.

> Source/JavaScriptCore/b3/air/AirOpcode.opcodes:670
> +SignExtend8To64 U:G:8, D:G:Ptr

Let's not use Ptr here, and instead, let's use 64. It is also nice if we can define SignExtend32To64 as well :)

> Source/JavaScriptCore/b3/air/AirOpcode.opcodes:673
> +SignExtend16To64 U:G:16, D:G:Ptr

Ditto.

> Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp:-4627
>      auto temp = g32();
>      append(Move32, arg0, temp);
> -    append(SignExtend8To32, temp, temp);
> -    append(SignExtend32ToPtr, temp, result);

Let's just make `append(SignExtend8To64, arg0, result);`. We do not need to have temp :)

> Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp:4635
>      auto temp = g32();
>      append(Move32, arg0, temp);
> -    append(SignExtend16To32, temp, temp);
> -    append(SignExtend32ToPtr, temp, result);
> +    append(SignExtend16To64, temp, result);

Ditto.
Comment 3 Sergey Rubanov 2020-11-30 16:57:56 PST
Comment on attachment 415079 [details]
WIP

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

> Source/JavaScriptCore/b3/B3Opcode.cpp:220
> +        out.print("SExt8To64");

out.print("SExt16To64");
Comment 4 Sergey Rubanov 2021-12-25 21:23:59 PST
Created attachment 447968 [details]
WIP
Comment 6 Radar WebKit Bug Importer 2023-03-10 15:09:57 PST
<rdar://problem/106574794>
Comment 7 Yusuke Suzuki 2023-03-10 15:11:25 PST
Pull request: https://github.com/WebKit/WebKit/pull/11386
Comment 8 EWS 2023-03-14 16:54:14 PDT
Committed 261660@main (1fac7761b9cd): <https://commits.webkit.org/261660@main>

Reviewed commits have been landed. Closing PR #11386 and removing active labels.