x86 push can take a memory reference operand.
authorTaylor R Campbell <campbell@mumble.net>
Wed, 5 Dec 2018 05:56:55 +0000 (05:56 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Wed, 5 Dec 2018 06:17:01 +0000 (06:17 +0000)
Conveniently, it evaluates rsp before modifying it too.

Shaves about 1% off the runtime.

src/compiler/machines/x86-64/rules1.scm

index 787d502434a2a6d49cb648f4ae2ea97285f772f7..09a02bea706aee04582daf1099d5b344d730b57f 100644 (file)
@@ -285,6 +285,10 @@ USA.
   (with-unsigned-immediate-operand (make-non-pointer-literal type datum)
     (lambda (operand)
       (LAP (PUSH Q ,operand)))))
+
+(define-rule statement
+  (ASSIGN (PRE-INCREMENT (REGISTER 4) -1) (? expression rtl:simple-offset?))
+  (LAP (PUSH Q ,(offset->reference! expression))))
 \f
 ;;;; CHAR->ASCII/BYTE-OFFSET