x86_64: Fix svml_s_exp10f4_core_sse4.S code formatting

This commit contains following formatting changes

1. Instructions proceeded by a tab.
2. Instruction less than 8 characters in length have a tab
   between it and the first operand.
3. Instruction greater than 7 characters in length have a
   space between it and the first operand.
4. Tabs after `#define`d names and their value.
5. 8 space at the beginning of line replaced by tab.
6. Indent comments with code.
7. Remove redundent .text section.
8. 1 space between line content and line comment.
9. Space after all commas.

Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
This commit is contained in:
Sunil K Pandey 2022-03-07 10:47:12 -08:00
parent 00e651209b
commit dcc7a3e02d

View File

@ -22,7 +22,7 @@
* exp10(x) = 2^x/log10(2) = 2^n * (1 + T[j]) * (1 + P(y))
* where
* x = m*log10(2)/K + y, y in [-log10(2)/K..log10(2)/K]
* m = n*K + j, m,n,j - signed integer, j in [-K/2..K/2]
* m = n*K + j, m, n,j - signed integer, j in [-K/2..K/2]
*
* values of 2^j/K are tabulated
*
@ -57,20 +57,19 @@
#include <sysdep.h>
.text
.section .text.sse4,"ax",@progbits
.section .text.sse4, "ax", @progbits
ENTRY(_ZGVbN4v_exp10f_sse4)
subq $72, %rsp
cfi_def_cfa_offset(80)
movaps %xmm0, %xmm4
/* Load arument */
/* Load arument */
movups _sLg2_10+__svml_sexp10_data_internal(%rip), %xmm2
lea __svml_sexp10_data_internal(%rip), %r8
mulps %xmm4, %xmm2
movups _sShifter+__svml_sexp10_data_internal(%rip), %xmm5
/* R */
/* R */
movups _sInvLg2_10hi+__svml_sexp10_data_internal(%rip), %xmm14
addps %xmm5, %xmm2
movaps %xmm2, %xmm1
@ -81,7 +80,7 @@ ENTRY(_ZGVbN4v_exp10f_sse4)
mulps %xmm1, %xmm15
subps %xmm14, %xmm5
/*
/*
* Polynomial
* exp10 = 2^N*(Tj+Tj*poly)
* poly(sN) = {1+later} a0+a1*sR
@ -91,17 +90,17 @@ ENTRY(_ZGVbN4v_exp10f_sse4)
mulps %xmm5, %xmm1
movdqu _iIndexMask+__svml_sexp10_data_internal(%rip), %xmm3
/* Index and lookup */
/* Index and lookup */
movdqa %xmm3, %xmm10
/* remove index bits */
/* remove index bits */
pandn %xmm2, %xmm3
pand %xmm2, %xmm10
/* 2^N */
/* 2^N */
pslld $18, %xmm3
/* iIndex *= sizeof(S); */
/* iIndex *= sizeof(S); */
pslld $2, %xmm10
addps _sPC1+__svml_sexp10_data_internal(%rip), %xmm1
movd %xmm10, %edx
@ -112,7 +111,7 @@ ENTRY(_ZGVbN4v_exp10f_sse4)
movd %xmm9, %esi
movd %xmm11, %edi
/* Check for overflow\underflow */
/* Check for overflow\underflow */
movdqu _iAbsMask+__svml_sexp10_data_internal(%rip), %xmm6
pand %xmm4, %xmm6
mulps %xmm1, %xmm5
@ -121,31 +120,31 @@ ENTRY(_ZGVbN4v_exp10f_sse4)
movslq %ecx, %rcx
movslq %esi, %rsi
movslq %edi, %rdi
movd (%r8,%rdx), %xmm0
movd (%r8,%rcx), %xmm8
movd (%r8,%rsi), %xmm13
movd (%r8,%rdi), %xmm12
movd (%r8, %rdx), %xmm0
movd (%r8, %rcx), %xmm8
movd (%r8, %rsi), %xmm13
movd (%r8, %rdi), %xmm12
punpckldq %xmm8, %xmm0
punpckldq %xmm12, %xmm13
punpcklqdq %xmm13, %xmm0
/* Tj_l+Tj_h*poly */
/* Tj_l+Tj_h*poly */
mulps %xmm0, %xmm5
pcmpgtd _iDomainRange+__svml_sexp10_data_internal(%rip), %xmm6
addps %xmm5, %xmm0
movmskps %xmm6, %eax
/* quick mul 2^N */
/* quick mul 2^N */
paddd %xmm3, %xmm0
/* Finish */
/* Finish */
testl %eax, %eax
/* Go to special inputs processing branch */
/* Go to special inputs processing branch */
jne L(SPECIAL_VALUES_BRANCH)
# LOE rbx rbp r12 r13 r14 r15 eax xmm0 xmm4
/* Restore registers
/* Restore registers
* and exit the function
*/
@ -155,7 +154,7 @@ L(EXIT):
ret
cfi_def_cfa_offset(80)
/* Branch to process
/* Branch to process
* special inputs
*/
@ -175,18 +174,18 @@ L(SPECIAL_VALUES_BRANCH):
cfi_offset(14, -80)
# LOE rbx rbp r15 r12d r13d
/* Range mask
/* Range mask
* bits check
*/
L(RANGEMASK_CHECK):
btl %r12d, %r13d
/* Call scalar math function */
/* Call scalar math function */
jc L(SCALAR_MATH_CALL)
# LOE rbx rbp r15 r12d r13d
/* Special inputs
/* Special inputs
* processing loop
*/
@ -194,7 +193,7 @@ L(SPECIAL_VALUES_LOOP):
incl %r12d
cmpl $4, %r12d
/* Check bits in range mask */
/* Check bits in range mask */
jl L(RANGEMASK_CHECK)
# LOE rbx rbp r15 r12d r13d
@ -206,26 +205,26 @@ L(SPECIAL_VALUES_LOOP):
cfi_restore(14)
movups 48(%rsp), %xmm0
/* Go to exit */
/* Go to exit */
jmp L(EXIT)
cfi_offset(12, -64)
cfi_offset(13, -72)
cfi_offset(14, -80)
# LOE rbx rbp r12 r13 r14 r15 xmm0
/* Scalar math fucntion call
/* Scalar math fucntion call
* to process special input
*/
L(SCALAR_MATH_CALL):
movl %r12d, %r14d
movss 32(%rsp,%r14,4), %xmm0
movss 32(%rsp, %r14, 4), %xmm0
call exp10f@PLT
# LOE rbx rbp r14 r15 r12d r13d xmm0
movss %xmm0, 48(%rsp,%r14,4)
movss %xmm0, 48(%rsp, %r14, 4)
/* Process special inputs in loop */
/* Process special inputs in loop */
jmp L(SPECIAL_VALUES_LOOP)
# LOE rbx rbp r15 r12d r13d
END(_ZGVbN4v_exp10f_sse4)
@ -235,8 +234,7 @@ END(_ZGVbN4v_exp10f_sse4)
#ifdef __svml_sexp10_data_internal_typedef
typedef unsigned int VUINT32;
typedef struct
{
typedef struct {
__declspec(align(16)) VUINT32 _sT[(1<<5)][1];
__declspec(align(16)) VUINT32 _sLg2_10[4][1];
__declspec(align(16)) VUINT32 _sShifter[4][1];
@ -251,7 +249,7 @@ typedef struct
} __svml_sexp10_data_internal;
#endif
__svml_sexp10_data_internal:
/*== _sT ==*/
/* _sT */
.long 0x3f800000 // 2^( 0 /32 )
.long 0x3f82cd87 // 2^( 1 /32 )
.long 0x3f85aac3 // 2^( 2 /32 )
@ -289,7 +287,7 @@ __svml_sexp10_data_internal:
.align 16
.long 0x4b400000, 0x4b400000, 0x4b400000, 0x4b400000 /* _sShifter) */
.align 16
.long 0x3c1a2000, 0x3c1a2000, 0x3c1a2000, 0x3c1a2000 /* _sInvLg2_10hi/2^K hi (24-K-7) bits*/
.long 0x3c1a2000, 0x3c1a2000, 0x3c1a2000, 0x3c1a2000 /* _sInvLg2_10hi/2^K hi (24-K-7) bits */
.align 16
.long 0x341a84fc, 0x341a84fc, 0x341a84fc, 0x341a84fc /* _sInvLg2_10lo/2^K lo bits */
// otherwise exp10(0) won't produce exact 1.0
@ -300,12 +298,12 @@ __svml_sexp10_data_internal:
.align 16
.long 0x4029a8d2, 0x4029a8d2, 0x4029a8d2, 0x4029a8d2 /* _sPC2 */
.align 16
.long 0x0000001f, 0x0000001f, 0x0000001f, 0x0000001f /* _iIndexMask =(2^K-1)*/
.long 0x0000001f, 0x0000001f, 0x0000001f, 0x0000001f /* _iIndexMask =(2^K-1) */
//common
.align 16
.long 0x7fffffff, 0x7fffffff, 0x7fffffff, 0x7fffffff /* _iAbsMask */
.align 16
.long 0x4217b818, 0x4217b818, 0x4217b818, 0x4217b818 /* _iDomainRange=-log10(max_denormal=0x007fffff) RZ */
.align 16
.type __svml_sexp10_data_internal,@object
.size __svml_sexp10_data_internal,.-__svml_sexp10_data_internal
.type __svml_sexp10_data_internal, @object
.size __svml_sexp10_data_internal, .-__svml_sexp10_data_internal