Bug 260869

Summary: Take additional GPR operand for offlineasm instructions that need a scratch register
Product: WebKit Reporter: Ian Grunert <ian.grunert>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 222315    

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.