From 1ed07ba10c48f2754a97e15502c717bf5d9e7a59 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sun, 30 Dec 2018 23:33:21 +0000 Subject: [PATCH] Use 32-bit xor rather than 64-bit xor for zeroing. --- src/compiler/machines/x86-64/lapgen.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/compiler/machines/x86-64/lapgen.scm b/src/compiler/machines/x86-64/lapgen.scm index 50312549c..0ca2495c2 100644 --- a/src/compiler/machines/x86-64/lapgen.scm +++ b/src/compiler/machines/x86-64/lapgen.scm @@ -290,7 +290,9 @@ USA. (define (load-signed-immediate target value) (cond ((zero? value) - (LAP (XOR Q ,target ,target))) + ;; This zeros the upper half of the target, and is a shorter + ;; instruction than (XOR Q ...). + (LAP (XOR L ,target ,target))) ((fits-in-signed-quad? value) (LAP (MOV Q ,target (& ,value)))) (else @@ -298,7 +300,9 @@ USA. (define (load-unsigned-immediate target value) (cond ((zero? value) - (LAP (XOR Q ,target ,target))) + ;; This zeros the upper half of the target, and is a shorter + ;; instruction than (XOR Q ...). + (LAP (XOR L ,target ,target))) ((fits-in-unsigned-quad? value) (LAP (MOV Q ,target (&U ,value)))) (else -- 2.25.1