From 1b5ddcbadd1eaa0375da61a0eed0b810b239a4b4 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Thu, 10 Sep 2026 23:40:19 -0700 Subject: began to check and correct the exact hex-transformed instruction output the checking is only a little way down the file, but there's a new feature needed, so this is being checked in now to protect the work that's already been done Force-Push: yes Change-Id: If8c29d4b417288e5cfb2aa08ce6d41adadc64279 --- amd64.e | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/amd64.e b/amd64.e index e76f33a..a6503f0 100644 --- a/amd64.e +++ b/amd64.e @@ -497,8 +497,9 @@ s" :cc-greater" keyword ~ (equality result, output point) ~ If the R/M register was rsp, we need an SIB byte; otherwise, skip it. swap { - 0 4 :rsp reg64 sib + 0 4 :rsp reg64 ~ : drop-subitem + sib } if exit } if @@ -515,8 +516,9 @@ s" :cc-greater" keyword reg64 1 3unroll modrm ~ If the R/M register was rsp, we need an SIB byte; otherwise, skip it. 3roll { - 0 4 :rsp reg64 sib + 0 4 :rsp reg64 ~ : drop-subitem + sib } if ~ The displacement byte. @@ -549,8 +551,9 @@ s" :cc-greater" keyword reg64 2 3unroll modrm ~ If the R/M register was rsp, we need an SIB byte; otherwise, skip it. 3roll { - 0 4 :rsp reg64 sib + 0 4 :rsp reg64 ~ : drop-subitem + sib } if ~ The displacement value. This is subject to the same considerations as in @@ -644,10 +647,10 @@ s" :cc-greater" keyword ~ (output point, target register -- output point) : pop-reg64 - ~ : 1 # pop-reg64 + ~ : 0 # pop-reg64 reg64 0x58 opcodereg ; : pop-extrareg64 - ~ : 2 # pop-extrareg64 + ~ : 0 # pop-extrareg64 swap rex-b swap extrareg64 0x58 opcodereg ; ~ Note the use of the B rex bit here; this instruction puts the register ~ number in the opcode field, so it uses Table 3-1. @@ -728,16 +731,17 @@ s" :cc-greater" keyword ~ (output point, source register, target register -- output point) : mov-reg64-reg64 - ~ : 1 # # mov-reg64-reg64 + ~ : 1 #swap # # mov-reg64-reg64 3roll rex-w 0x89 pack8 3unroll swap reg64 swap addressing-reg64 ; : mov-indirect-reg64-reg64 - ~ : 1 # # mov-indirect-reg64-reg64 + ~ : 1 #swap # # mov-indirect-reg64-reg64 3roll rex-w 0x89 pack8 3unroll swap reg64 swap addressing-indirect-reg64 ; ~ (output point, source register, target register, target displacement value ~ -- output point) +~ TODO IAK this is where the verification is up to : mov-disp8-reg64-reg64 ~ : 1 # # # mov-disp8-reg64-reg64 4 roll rex-w 0x89 pack8 4 unroll -- cgit 1.4.1