Bug 260869 - Take additional GPR operand for offlineasm instructions that need a scratch register
Summary: Take additional GPR operand for offlineasm instructions that need a scratch r...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 222315
  Show dependency treegraph
 
Reported: 2023-08-29 12:15 PDT by Ian Grunert
Modified: 2023-09-22 12:33 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Grunert 2023-08-29 12:15:38 PDT
In offlineasm we reserve r11 as a scratch register on x86, for truncatef2q, truncated2q, cq2f, cq2d, absf, absd, negf, negd.

We can change those instructions to take an additional GPR for use as a scratch register, and return the power to choose when to use r11 to the programmer.
Comment 1 Ian Grunert 2023-08-30 07:34:13 PDT
Pull request: https://github.com/WebKit/WebKit/pull/17224
Comment 2 Ian Grunert 2023-08-30 10:32:29 PDT
Pull request: https://github.com/WebKit/WebKit/pull/17231
Comment 3 Radar WebKit Bug Importer 2023-09-05 12:16:33 PDT
<rdar://problem/114999616>
Comment 4 Ian Grunert 2023-09-22 12:33:18 PDT
The idea here was to make it clear when r11 was being used, such that on Windows we could use r11 for ws1 in WebAssembly.asm. I was unaware that MacroAssemblerX86_64 required r11 for other operations, I'd assumed it's primary purpose was for the usages I could see in offlineasm's x86.rb.

We'll have to use an alternate approach to ws1 usage in WebAssembly.asm.