From 1ac41d34baf3a1ba387105526dec344d935c14c5 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Thu, 17 Jul 2008 14:20:06 -0700 Subject: [PATCH] smartalign: 16-bit generic alignment macros Smart alignment content for 16-bit "generic" mode --- macros/smartalign.mac | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/macros/smartalign.mac b/macros/smartalign.mac index 921ced81..6ff294ae 100644 --- a/macros/smartalign.mac +++ b/macros/smartalign.mac @@ -4,11 +4,7 @@ USE: smartalign %imacro alignmode 1-2.nolist - %ifnempty %2 - %xdefine __ALIGN_JMP_THRESHOLD__ %2 - %else - %define __ALIGN_JMP_THRESHOLD__ 17 - %endif + %define __ALIGN_JMP_THRESHOLD__ 17 %ifidni %1,nop %define __ALIGN_16BIT_1B__ 0x90 %define __ALIGN_16BIT_2B__ 0x90,0x90 @@ -38,13 +34,13 @@ USE: smartalign %define __ALIGN_64BIT_8B__ 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90 %elifidni %1,generic %define __ALIGN_16BIT_1B__ 0x90 - %define __ALIGN_16BIT_2B__ 0x90,0x90 - %define __ALIGN_16BIT_3B__ 0x90,0x90,0x90 - %define __ALIGN_16BIT_4B__ 0x90,0x90,0x90,0x90 - %define __ALIGN_16BIT_5B__ 0x90,0x90,0x90,0x90,0x90 - %define __ALIGN_16BIT_6B__ 0x90,0x90,0x90,0x90,0x90,0x90 - %define __ALIGN_16BIT_7B__ 0x90,0x90,0x90,0x90,0x90,0x90,0x90 - %define __ALIGN_16BIT_8B__ 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90 + %define __ALIGN_16BIT_2B__ 0x89,0xf6 + %define __ALIGN_16BIT_3B__ 0x8d,0x74,0x00 + %define __ALIGN_16BIT_4B__ 0x8d,0xb4,0x00,0x00 + %define __ALIGN_16BIT_5B__ 0x90,0x8d,0xb4,0x00,0x00 + %define __ALIGN_16BIT_6B__ 0x89,0xf6,0x8d,0xbd,0x00,0x00 + %define __ALIGN_16BIT_7B__ 0x8d,0x74,0x00,0x8d,0xbd,0x00,0x00 + %define __ALIGN_16BIT_8B__ 0x8d,0xb4,0x00,0x00,0x8d,0xbd,0x00,0x00 %define __ALIGN_32BIT_1B__ 0x90 %define __ALIGN_32BIT_2B__ 0x89,0xf6 @@ -147,6 +143,9 @@ USE: smartalign %else %error unknown alignment mode: %1 %endif + %ifnempty %2 + %xdefine __ALIGN_JMP_THRESHOLD__ %2 + %endif %xdefine __ALIGNMODE__ %1,__ALIGN_JMP_THRESHOLD__ %endmacro -- 2.11.4.GIT