Don't use %rcx directly with CoffTlsGetAddr (#5278)

Avoid naming %rcx as written by the CoffTlsGetAddr pseudo-instruction in the x64 backend, and instead emit a fixed-def constraint for a fresh VReg and %rcx.
This commit is contained in:
Trevor Elliott
2022-11-16 11:32:09 -08:00
committed by GitHub
parent 5a006674c3
commit 4780bd5902
4 changed files with 31 additions and 7 deletions

View File

@@ -513,7 +513,8 @@
;; A Coff TLS symbol access. Returns address of the TLS symbol in
;; `dst`, which is constrained to `rax`.
(CoffTlsGetAddr (symbol ExternalName)
(dst WritableGpr))
(dst WritableGpr)
(tmp WritableGpr))
;; An unwind pseudoinstruction describing the state of the machine at
;; this program point.
@@ -3759,7 +3760,8 @@
(decl coff_tls_get_addr (ExternalName) Gpr)
(rule (coff_tls_get_addr name)
(let ((dst WritableGpr (temp_writable_gpr))
(_ Unit (emit (MInst.CoffTlsGetAddr name dst))))
(tmp WritableGpr (temp_writable_gpr))
(_ Unit (emit (MInst.CoffTlsGetAddr name dst tmp))))
dst))
;;;; sqmul_round_sat ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;