x86_64: fix popcount without POPCNT

Commit 68b2f597ec moved the argument from RDI to RCX, but the
`popcount-slow` function wasn't updated.

Related to racket/racket#3150

original commit: 80ffa4eea197a885cd647fcfb76dda720b64781d
This commit is contained in:
Matthew Flatt 2020-05-06 12:11:14 -06:00
parent c7f4261611
commit 0d225f5505
2 changed files with 4 additions and 4 deletions

View File

@ -13670,7 +13670,7 @@
,(constant-case architecture
[(x86_64)
`(seq
(set! ,%rax (inline ,(make-info-inline) ,%popcount ,%rdi))
(set! ,%rax (inline ,(make-info-inline) ,%popcount ,%rcx))
(asm-c-return ,null-info ,%rax))]
[else
;; Generate anything, since this should not get called

View File

@ -1642,9 +1642,9 @@
(asm-helper-call code* target dest-rax)]
[else
;; Used for the body of `popcount-slow`.
;; This is the sequence generated by LLVM's __builtin_popcountl()
;; __builtin_popcountl() intrinsic, but with pushes and pops
;; to save used registers other than the result register %rax.
;; This is the sequence generated by LLVM's __builtin_popcountl(),
;; but with pushes and pops to save used registers other than the
;; result register %rax.
(emit-literal-code (op dest-rax src-rcx code*)
51 ; pushq %rcx
57 ; pushq %rdi