x86: Add ENDBR32/ENDBR64 at function entries for Intel CET

To support Intel CET, all indirect branch targets must start with
ENDBR32/ENDBR64.  Here is a patch to define endbranch and add it to
function entries in x86 assembly codes which are indirect branch
targets as discovered by running testsuite on Intel CET machine and
visual inspection.

Verified with

$ CC="gcc -Wl,-z,cet-report=error -fcf-protection" CXX="g++ -Wl,-z,cet-report=error -fcf-protection" .../configure x86_64-linux
$ make -j8
$ make -j8 check

with both nasm and yasm on both CET and non-CET machines.

Change-Id: I9822578e7294fb5043a64ab7de5c41de81a7d337
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
This commit is contained in:
H.J. Lu 2020-05-22 10:46:50 -07:00 committed by Greg Tucker
parent 031450f697
commit cd888f01a4
106 changed files with 149 additions and 85 deletions

View File

@ -75,6 +75,7 @@ section .text
align 16
mk_global crc16_t10dif_01, function
crc16_t10dif_01:
endbranch
; adjust the 16-bit initial_crc value, scale it to 32 bits
shl arg1_low32, 16

View File

@ -75,6 +75,7 @@ section .text
align 16
mk_global crc16_t10dif_02, function
crc16_t10dif_02:
endbranch
; adjust the 16-bit initial_crc value, scale it to 32 bits
shl arg1_low32, 16

View File

@ -84,6 +84,7 @@ section .text
align 16
mk_global FUNCTION_NAME, function
FUNCTION_NAME:
endbranch
; adjust the 16-bit initial_crc value, scale it to 32 bits
shl arg1_low32, 16

View File

@ -68,6 +68,7 @@ section .text
align 16
mk_global crc16_t10dif_by4, function
crc16_t10dif_by4:
endbranch
; adjust the 16-bit initial_crc value, scale it to 32 bits
shl arg1_low32, 16

View File

@ -71,6 +71,7 @@ section .text
align 16
mk_global crc16_t10dif_copy_by4, function
crc16_t10dif_copy_by4:
endbranch
; adjust the 16-bit initial_crc value, scale it to 32 bits
shl arg1_low32, 16

View File

@ -71,6 +71,7 @@ section .text
align 16
mk_global crc16_t10dif_copy_by4_02, function
crc16_t10dif_copy_by4_02:
endbranch
; adjust the 16-bit initial_crc value, scale it to 32 bits
shl arg1_low32, 16

View File

@ -94,6 +94,7 @@ section .text
align 16
mk_global FUNCTION_NAME, function
FUNCTION_NAME:
endbranch
not arg1_low32
sub rsp, VARIABLE_OFFSET

View File

@ -88,6 +88,7 @@ section .text
align 16
mk_global crc32_gzip_refl_by8, function
crc32_gzip_refl_by8:
endbranch
; unsigned long c = crc ^ 0xffffffffL;
not arg1_low32 ;

View File

@ -88,6 +88,7 @@ section .text
align 16
mk_global crc32_gzip_refl_by8_02, function
crc32_gzip_refl_by8_02:
endbranch
not arg1_low32
sub rsp, VARIABLE_OFFSET

View File

@ -74,6 +74,7 @@ section .text
align 16
mk_global crc32_ieee_01, function
crc32_ieee_01:
endbranch
not arg1_low32 ;~init_crc

View File

@ -74,6 +74,7 @@ section .text
align 16
mk_global crc32_ieee_02, function
crc32_ieee_02:
endbranch
not arg1_low32 ;~init_crc

View File

@ -84,6 +84,7 @@ section .text
align 16
mk_global FUNCTION_NAME, function
FUNCTION_NAME:
endbranch
not arg1_low32
sub rsp, VARIABLE_OFFSET

View File

@ -76,6 +76,7 @@ section .text
align 16
mk_global crc32_ieee_by4, function
crc32_ieee_by4:
endbranch
not arg1_low32

View File

@ -155,6 +155,7 @@ default rel
mk_global crc32_iscsi_00, function
crc32_iscsi_00:
endbranch
%ifidn __OUTPUT_FORMAT__, elf64
%define bufp rdi

View File

@ -52,6 +52,7 @@ default rel
mk_global crc32_iscsi_01, function
crc32_iscsi_01:
endbranch
%ifidn __OUTPUT_FORMAT__, elf64
%define bufp rdi
@ -214,6 +215,7 @@ non_prefetch:
%rep 128-1
CONCAT(crc_,i,:)
endbranch
crc32 crc_init, qword [block_0 - i*8]
crc32 crc1, qword [block_1 - i*8]
crc32 crc2, qword [block_2 - i*8]

View File

@ -64,6 +64,7 @@ section .text
align 16
mk_global crc64_ecma_norm_by8, function
crc64_ecma_norm_by8:
endbranch
not arg1 ;~init_crc

View File

@ -70,6 +70,7 @@ section .text
align 16
mk_global crc64_ecma_refl_by8, function
crc64_ecma_refl_by8:
endbranch
; uint64_t c = crc ^ 0xffffffff,ffffffffL;
not arg1
sub rsp, VARIABLE_OFFSET

View File

@ -71,6 +71,7 @@ section .text
align 16
mk_global FUNCTION_NAME, function
FUNCTION_NAME:
endbranch
not arg1
sub rsp, VARIABLE_OFFSET

View File

@ -63,6 +63,7 @@ section .text
align 16
mk_global crc64_iso_norm_by8, function
crc64_iso_norm_by8:
endbranch
not arg1 ;~init_crc

View File

@ -72,6 +72,7 @@ section .text
align 16
mk_global FUNCTION_NAME, function
FUNCTION_NAME:
endbranch
not arg1
sub rsp, VARIABLE_OFFSET

View File

@ -67,6 +67,7 @@ section .text
align 16
mk_global crc64_iso_refl_by8, function
crc64_iso_refl_by8:
endbranch
; uint64_t c = crc ^ 0xffffffff,ffffffffL;
not arg1
sub rsp, VARIABLE_OFFSET

View File

@ -63,6 +63,7 @@ section .text
align 16
mk_global crc64_jones_norm_by8, function
crc64_jones_norm_by8:
endbranch
not arg1 ;~init_crc

View File

@ -67,6 +67,7 @@ section .text
align 16
mk_global crc64_jones_refl_by8, function
crc64_jones_refl_by8:
endbranch
; uint64_t c = crc ^ 0xffffffff,ffffffffL;
not arg1
sub rsp, VARIABLE_OFFSET

View File

@ -81,8 +81,10 @@ section .text
;;;;
mk_global crc32_iscsi, function
crc32_iscsi_mbinit:
endbranch
call crc32_iscsi_dispatch_init
crc32_iscsi:
endbranch
jmp qword [crc32_iscsi_dispatched]
crc32_iscsi_dispatch_init:
@ -115,8 +117,10 @@ crc32_iscsi_dispatch_init:
;;;;
mk_global crc32_ieee, function
crc32_ieee_mbinit:
endbranch
call crc32_ieee_dispatch_init
crc32_ieee:
endbranch
jmp qword [crc32_ieee_dispatched]
crc32_ieee_dispatch_init:
@ -194,8 +198,10 @@ crc32_ieee_dispatch_init:
;;;;
mk_global crc16_t10dif, function
crc16_t10dif_mbinit:
endbranch
call crc16_t10dif_dispatch_init
crc16_t10dif:
endbranch
jmp qword [crc16_t10dif_dispatched]
crc16_t10dif_dispatch_init:

View File

@ -52,7 +52,7 @@
%define PS 8
%define LOG_PS 3
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
%endmacro
@ -127,7 +127,7 @@
%define PS 4
%define LOG_PS 2
%define func(x) x:
%define func(x) x: endbranch
%define arg(x) [ebp + PS*2 + PS*x]
%define var(x) [ebp - PS - PS*x]

View File

@ -54,7 +54,7 @@
%define PS 8
%define LOG_PS 3
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
%endmacro
@ -131,7 +131,7 @@
%define PS 4
%define LOG_PS 2
%define func(x) x:
%define func(x) x: endbranch
%define arg(x) [ebp + PS*2 + PS*x]
%define var(x) [ebp - PS - PS*x]

View File

@ -50,7 +50,7 @@
%define PS 8
%define LOG_PS 3
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
%endmacro

View File

@ -52,7 +52,7 @@
%define PS 8
%define LOG_PS 3
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
%endmacro
@ -127,7 +127,7 @@
%define PS 4
%define LOG_PS 2
%define func(x) x:
%define func(x) x: endbranch
%define arg(x) [ebp + PS*2 + PS*x]
%define var(x) [ebp - PS - PS*x]

View File

@ -97,7 +97,7 @@
%define return rax
%define return.w eax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -104,7 +104,7 @@
%define return rax
%define return.w eax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -45,7 +45,7 @@
%define tmp r11
%define tmp2 r10
%define return rax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -97,7 +97,7 @@
%define return rax
%define return.w eax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -52,7 +52,7 @@
%define PS 8
%define LOG_PS 3
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13
@ -139,7 +139,7 @@
%define PS 4
%define LOG_PS 2
%define func(x) x:
%define func(x) x: endbranch
%define arg(x) [ebp + PS*2 + PS*x]
%define var(x) [ebp - PS - PS*x]

View File

@ -54,7 +54,7 @@
%define PS 8
%define LOG_PS 3
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13
@ -143,7 +143,7 @@
%define PS 4
%define LOG_PS 2
%define func(x) x:
%define func(x) x: endbranch
%define arg(x) [ebp + PS*2 + PS*x]
%define var(x) [ebp - PS - PS*x]

View File

@ -53,7 +53,7 @@
%define PS 8
%define LOG_PS 3
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13

View File

@ -52,7 +52,7 @@
%define PS 8
%define LOG_PS 3
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13
@ -139,7 +139,7 @@
%define PS 4
%define LOG_PS 2
%define func(x) x:
%define func(x) x: endbranch
%define arg(x) [ebp + PS*2 + PS*x]
%define var(x) [ebp - PS - PS*x]

View File

@ -97,7 +97,7 @@
%define return rax
%define return.w eax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -103,7 +103,7 @@
%define return rax
%define return.w eax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -44,7 +44,7 @@
%define arg5 r9
%define tmp r11
%define return rax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -96,7 +96,7 @@
%define return rax
%define return.w eax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -54,7 +54,7 @@
%define PS 8
%define LOG_PS 3
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13
@ -159,7 +159,7 @@
%define PS 4
%define LOG_PS 2
%define func(x) x:
%define func(x) x: endbranch
%define arg(x) [ebp + PS*2 + PS*x]
%define var(x) [ebp - PS - PS*x]

View File

@ -56,7 +56,7 @@
%define PS 8
%define LOG_PS 3
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13
@ -163,7 +163,7 @@
%define PS 4
%define LOG_PS 2
%define func(x) x:
%define func(x) x: endbranch
%define arg(x) [ebp + PS*2 + PS*x]
%define var(x) [ebp - PS - PS*x]

View File

@ -55,7 +55,7 @@
%define PS 8
%define LOG_PS 3
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13

View File

@ -54,7 +54,7 @@
%define PS 8
%define LOG_PS 3
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13
@ -159,7 +159,7 @@
%define PS 4
%define LOG_PS 2
%define func(x) x:
%define func(x) x: endbranch
%define arg(x) [ebp + PS*2 + PS*x]
%define var(x) [ebp - PS - PS*x]

View File

@ -103,7 +103,7 @@
%define return rax
%define return.w eax
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
%endmacro

View File

@ -101,7 +101,7 @@
%define return rax
%define return.w eax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -44,7 +44,7 @@
%define arg5 r9
%define tmp r11
%define return rax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -103,7 +103,7 @@
%define return rax
%define return.w eax
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
%endmacro

View File

@ -51,7 +51,7 @@
%define PS 8
%define LOG_PS 3
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13

View File

@ -53,7 +53,7 @@
%define PS 8
%define LOG_PS 3
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13

View File

@ -57,7 +57,7 @@
%define PS 8
%define LOG_PS 3
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13

View File

@ -51,7 +51,7 @@
%define PS 8
%define LOG_PS 3
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13

View File

@ -107,7 +107,7 @@
%define return rax
%define return.w eax
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13

View File

@ -103,7 +103,7 @@
%define return rax
%define return.w eax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -45,7 +45,7 @@
%define tmp r11
%define tmp2 r10
%define return rax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -107,7 +107,7 @@
%define return rax
%define return.w eax
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13

View File

@ -51,7 +51,7 @@
%define PS 8
%define LOG_PS 3
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13

View File

@ -53,7 +53,7 @@
%define PS 8
%define LOG_PS 3
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13

View File

@ -57,7 +57,7 @@
%define PS 8
%define LOG_PS 3
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13

View File

@ -51,7 +51,7 @@
%define PS 8
%define LOG_PS 3
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13

View File

@ -111,7 +111,7 @@
%define return rax
%define return.w eax
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13

View File

@ -107,7 +107,7 @@
%define return rax
%define return.w eax
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
%endmacro

View File

@ -46,7 +46,7 @@
%define tmp2 r10
%define tmp3 r12 ;must be saved and restored
%define return rax
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
%endmacro

View File

@ -113,7 +113,7 @@
%define return rax
%define return.w eax
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13

View File

@ -48,7 +48,7 @@
%endmacro
%define SSTR SLDR
%define PS 8
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif
@ -106,7 +106,7 @@
%define PS 4
%define LOG_PS 2
%define func(x) x:
%define func(x) x: endbranch
%define arg(x) [ebp + PS*2 + PS*x]
%define trans ecx ;trans is for the variables in stack

View File

@ -51,7 +51,7 @@
%endmacro
%define SSTR SLDR
%define PS 8
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif
@ -111,7 +111,7 @@
%define PS 4
%define LOG_PS 2
%define func(x) x:
%define func(x) x: endbranch
%define arg(x) [ebp + PS*2 + PS*x]
%define trans ecx ;trans is for the variables in stack

View File

@ -49,7 +49,7 @@
%define PS 8
%define LOG_PS 3
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -48,7 +48,7 @@
%endmacro
%define SSTR SLDR
%define PS 8
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif
@ -106,7 +106,7 @@
%define PS 4
%define LOG_PS 2
%define func(x) x:
%define func(x) x: endbranch
%define arg(x) [ebp + PS*2 + PS*x]
%define trans ecx ;trans is for the variables in stack

View File

@ -82,7 +82,7 @@
%define return rax
%define return.w eax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -88,7 +88,7 @@
%define return rax
%define return.w eax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -44,7 +44,7 @@
%define arg5 r9
%define tmp r11
%define return rax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -82,7 +82,7 @@
%define return rax
%define return.w eax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -42,7 +42,7 @@
%define arg5 r9
%define tmp r11
%define return rax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE

View File

@ -42,7 +42,7 @@
%define arg5 r9
%define tmp r11
%define return rax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE

View File

@ -55,7 +55,7 @@ default rel
%define b_d r8d
%define end r13
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13

View File

@ -52,7 +52,7 @@ default rel
%define b_d r8d
%define end r13
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13

View File

@ -177,6 +177,7 @@ section .text
global encode_deflate_icf_ %+ ARCH
encode_deflate_icf_ %+ ARCH:
endbranch
FUNC_SAVE
%ifnidn ptr, arg1

View File

@ -190,6 +190,7 @@ section .text
global encode_deflate_icf_ %+ ARCH
encode_deflate_icf_ %+ ARCH:
endbranch
FUNC_SAVE
%ifnidn ptr, arg1

View File

@ -143,6 +143,7 @@ section .text
; arg 1: rcx: addr of stream
global isal_deflate_body_ %+ ARCH
isal_deflate_body_ %+ ARCH %+ :
endbranch
%ifidn __OUTPUT_FORMAT__, elf64
mov rcx, rdi
%endif

View File

@ -465,6 +465,7 @@ section .text
global decode_huffman_code_block_stateless_ %+ ARCH
decode_huffman_code_block_stateless_ %+ ARCH %+ :
endbranch
FUNC_SAVE

View File

@ -104,6 +104,7 @@ section .text
global isal_deflate_hash_crc_01
isal_deflate_hash_crc_01:
endbranch
FUNC_SAVE
neg f_i

View File

@ -94,6 +94,7 @@ section .text
; arg 1: rcx: addr of stream
global isal_deflate_finish_01
isal_deflate_finish_01:
endbranch
PUSH_ALL rbx, rsi, rdi, rbp, r12, r13, r14, r15
sub rsp, stack_size

View File

@ -147,7 +147,7 @@
%define stack_size 16
%define local_storage_offset 0
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push rbp
push r12
@ -175,6 +175,7 @@ section .text
global gen_icf_map_lh1_04
func(gen_icf_map_lh1_04)
endbranch
FUNC_SAVE
mov file_start, [stream + _next_in]

View File

@ -143,7 +143,7 @@
add rsp, stack_size
%endm
%else
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push rbp
push r12
@ -166,6 +166,7 @@ section .text
global gen_icf_map_lh1_06
func(gen_icf_map_lh1_06)
endbranch
FUNC_SAVE
mov file_start, [stream + _next_in]

View File

@ -164,6 +164,7 @@ section .text
; arg 1: rcx: addr of stream
global isal_deflate_icf_body_ %+ METHOD %+ _ %+ ARCH
isal_deflate_icf_body_ %+ METHOD %+ _ %+ ARCH %+ :
endbranch
%ifidn __OUTPUT_FORMAT__, elf64
mov rcx, rdi
%endif

View File

@ -102,6 +102,7 @@ section .text
; arg 1: rcx: addr of stream
global isal_deflate_icf_finish_ %+ METHOD %+ _01
isal_deflate_icf_finish_ %+ METHOD %+ _01:
endbranch
PUSH_ALL rbx, rsi, rdi, rbp, r12, r13, r14, r15
sub rsp, stack_size

View File

@ -122,7 +122,7 @@ default rel
add rsp, stack_size
%endm
%else
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13
@ -141,6 +141,7 @@ section .text
global set_long_icf_fg_04
func(set_long_icf_fg_04)
endbranch
FUNC_SAVE
lea end_in, [next_in + arg3]

View File

@ -129,7 +129,7 @@
add rsp, stack_size
%endm
%else
%define func(x) x:
%define func(x) x: endbranch
%macro FUNC_SAVE 0
push r12
push r13
@ -148,6 +148,7 @@ section .text
global set_long_icf_fg_06
func(set_long_icf_fg_06)
endbranch
FUNC_SAVE
lea end_in, [next_in + arg3]

View File

@ -256,6 +256,7 @@ section .text
; void isal_update_histogram
global isal_update_histogram_ %+ ARCH
isal_update_histogram_ %+ ARCH %+ :
endbranch
FUNC_SAVE
%ifnidn file_start, arg0

View File

@ -60,6 +60,7 @@ section .text
global build_huff_tree
build_huff_tree:
endbranch
%ifidn __OUTPUT_FORMAT__, win64
push rsi
push rdi
@ -108,6 +109,7 @@ build_huff_tree:
align 32
global build_heap
build_heap:
endbranch
%ifidn __OUTPUT_FORMAT__, win64
push rsi
push rdi

View File

@ -71,10 +71,12 @@
section .text
mk_global %1, function
%1_mbinit:
endbranch
;;; only called the first time to setup hardware match
call %1_dispatch_init
;;; falls thru to execute the hw optimized code
%1:
endbranch
jmp mbin_ptr_sz [%1_dispatched]
%endmacro

View File

@ -200,9 +200,22 @@ section .note.GNU-stack noalloc noexec nowrite progbits
section .text
%endif
%ifidn __OUTPUT_FORMAT__,elf64
%define __x86_64__
section .note.GNU-stack noalloc noexec nowrite progbits
section .text
%endif
%ifidn __OUTPUT_FORMAT__,win64
%define __x86_64__
%endif
%ifidn __OUTPUT_FORMAT__,macho64
%define __x86_64__
%endif
%ifdef __x86_64__
%define endbranch db 0xf3, 0x0f, 0x1e, 0xfa
%else
%define endbranch db 0xf3, 0x0f, 0x1e, 0xfb
%endif
%ifdef REL_TEXT
%define WRT_OPT

View File

@ -40,7 +40,7 @@
%define tmpb r11b
%define tmp3 arg4
%define return rax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -40,7 +40,7 @@
%define tmpb r11b
%define tmp3 arg4
%define return rax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -46,7 +46,7 @@
%define tmp r11
%define tmp3 arg4
%define return rax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -46,7 +46,7 @@
%define tmp r11
%define return rax
%define PS 8
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
@ -79,7 +79,7 @@
%define arg1 ecx
%define return eax
%define PS 4
%define func(x) x:
%define func(x) x: endbranch
%define arg(x) [ebp+8+PS*x]
%define arg2 edi ; must sav/restore
%define arg3 esi

View File

@ -46,7 +46,7 @@
%define tmp r11
%define tmp3 arg4
%define return rax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -46,7 +46,7 @@
%define tmp r11
%define tmp3 arg4
%define return rax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -49,7 +49,7 @@
%define tmp r11
%define tmp3 arg4
%define return rax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

View File

@ -46,7 +46,7 @@
%define tmp r11
%define tmp3 arg4
%define return rax
%define func(x) x:
%define func(x) x: endbranch
%define FUNC_SAVE
%define FUNC_RESTORE
%endif

Some files were not shown because too many files have changed in this diff Show More