x64: improve generation of i128 icmp (#3946)

Previously, we used the flags of `AND` for `SETcc`. This change uses
`TEST` instead, which discards the AND result but sets the flags needed
for `SETcc`. This reduces register pressure slightly for this sequence.
This commit is contained in:
Andrew Brown
2022-03-18 16:36:31 -07:00
committed by GitHub
parent 41594dc5d9
commit 5fa104205d
4 changed files with 131 additions and 134 deletions

View File

@@ -246,7 +246,7 @@ block0(v0: i128, v1: i128):
; Inst 10: cmpq %rcx, %rsi
; Inst 11: setz %r8b
; Inst 12: andq %r8, %rax
; Inst 13: andq $1, %rax
; Inst 13: testq $1, %rax
; Inst 14: setnz %al
; Inst 15: movq %rax, rsp(0 + virtual offset)
; Inst 16: cmpq %rdx, %rdi
@@ -254,7 +254,7 @@ block0(v0: i128, v1: i128):
; Inst 18: cmpq %rcx, %rsi
; Inst 19: setnz %r8b
; Inst 20: orq %r8, %rax
; Inst 21: andq $1, %rax
; Inst 21: testq $1, %rax
; Inst 22: setnz %r8b
; Inst 23: cmpq %rcx, %rsi
; Inst 24: setl %r9b