smartalign: 16-bit generic alignment macros

Smart alignment content for 16-bit "generic" mode
This commit is contained in:
H. Peter Anvin 2008-07-17 14:20:06 -07:00
parent 47b0c2d428
commit 1ac41d34ba

View File

@ -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