From 22e7b00ddbc2adcc351f9d3656956c5937fc8ee8 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Mon, 28 Dec 2015 17:06:48 +0100 Subject: [PATCH] DynASM/x64: Fix for full VREG support. Thanks to Peter Cawley. --- dynasm/dasm_x86.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dynasm/dasm_x86.h b/dynasm/dasm_x86.h index 4d2b773b..be9c289f 100644 --- a/dynasm/dasm_x86.h +++ b/dynasm/dasm_x86.h @@ -403,6 +403,7 @@ int dasm_encode(Dst_DECL, void *buffer) unsigned char *ex = cp - (t&7); if ((n & 8) && t < 0xa0) { if (*ex & 0x80) ex[1] ^= 0x20 << (t>>6); else *ex ^= 1 << (t>>6); + n &= 7; } else if (n & 0x10) { if (*ex & 0x80) { *ex = 0xc5; ex[1] = (ex[1] & 0x80) | ex[2]; ex += 2; @@ -410,8 +411,8 @@ int dasm_encode(Dst_DECL, void *buffer) while (++ex < cp) ex[-1] = *ex; if (mark) mark--; cp--; + n &= 7; } - n &= 7; if (t >= 0xc0) n <<= 4; else if (t >= 0x40) n <<= 3; else if (n == 4 && t < 0x20) { cp[-1] ^= n; *cp++ = 0x20; }