Skip to content

Commit

Permalink
More optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
sadko4u committed Dec 11, 2024
1 parent 6544567 commit 81da281
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 24 deletions.
28 changes: 10 additions & 18 deletions include/private/dsp/arch/x86/avx512/hmath/hsum.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ namespace lsp
(
__ASM_EMIT("vxorps %%zmm0, %%zmm0, %%zmm0")
__ASM_EMIT("vmovaps %[CC], %%zmm6")
__ASM_EMIT("vxorps %%zmm1, %%zmm1, %%zmm1")
__ASM_EMIT("vmovaps %%zmm6, %%zmm7")
__ASM_EMIT("vxorps %%zmm1, %%zmm1, %%zmm1")
/* x128 blocks */
__ASM_EMIT("sub $128, %[count]")
__ASM_EMIT("jb 2f")
Expand Down Expand Up @@ -282,35 +282,27 @@ namespace lsp
__ASM_EMIT("sub $32, %[count]")
__ASM_EMIT("jge 3b")
__ASM_EMIT("4:")
__ASM_EMIT("vextractf64x4 $1, %%zmm0, %%ymm2")
__ASM_EMIT("vextractf64x4 $1, %%zmm1, %%ymm3")
__ASM_EMIT("vaddps %%ymm2, %%ymm0, %%ymm0")
__ASM_EMIT("vaddps %%ymm3, %%ymm1, %%ymm1")
__ASM_EMIT("vaddps %%zmm1, %%zmm0, %%zmm0")
/* x16 block */
__ASM_EMIT("add $16, %[count]")
__ASM_EMIT("jl 6f")
__ASM_EMIT("vandps 0x000(%[src]), %%ymm6, %%ymm2")
__ASM_EMIT("vandps 0x020(%[src]), %%ymm7, %%ymm3")
__ASM_EMIT("vaddps %%ymm2, %%ymm0, %%ymm0")
__ASM_EMIT("vaddps %%ymm3, %%ymm1, %%ymm1")
__ASM_EMIT("vandps 0x000(%[src]), %%zmm6, %%zmm2")
__ASM_EMIT("vaddps %%zmm2, %%zmm0, %%zmm0")
__ASM_EMIT("add $0x40, %[src]")
__ASM_EMIT("sub $16, %[count]")
__ASM_EMIT("6:")
__ASM_EMIT("vextractf128 $1, %%ymm0, %%xmm2")
__ASM_EMIT("vextractf128 $1, %%ymm1, %%xmm3")
__ASM_EMIT("vaddps %%xmm2, %%xmm0, %%xmm0")
__ASM_EMIT("vaddps %%xmm3, %%xmm1, %%xmm1")
__ASM_EMIT("vextractf64x4 $1, %%zmm0, %%ymm2")
__ASM_EMIT("vaddps %%ymm2, %%ymm0, %%ymm0")
/* x8 block */
__ASM_EMIT("add $8, %[count]")
__ASM_EMIT("jl 8f")
__ASM_EMIT("vandps 0x000(%[src]), %%xmm6, %%xmm2")
__ASM_EMIT("vandps 0x010(%[src]), %%xmm7, %%xmm3")
__ASM_EMIT("vaddps %%xmm2, %%xmm0, %%xmm0")
__ASM_EMIT("vaddps %%xmm3, %%xmm1, %%xmm1")
__ASM_EMIT("vandps 0x000(%[src]), %%ymm6, %%ymm2")
__ASM_EMIT("vaddps %%ymm2, %%ymm0, %%ymm0")
__ASM_EMIT("add $0x20, %[src]")
__ASM_EMIT("sub $8, %[count]")
__ASM_EMIT("8:")
__ASM_EMIT("vaddps %%xmm1, %%xmm0, %%xmm0")
__ASM_EMIT("vextractf128 $1, %%ymm0, %%xmm2")
__ASM_EMIT("vaddps %%xmm2, %%xmm0, %%xmm0")
/* x4 block */
__ASM_EMIT("add $4, %[count]")
__ASM_EMIT("jl 10f")
Expand Down
2 changes: 1 addition & 1 deletion src/test/ptest/hmath/h_abs_dotp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace lsp
typedef float (* h_dotp_t)(const float *a, const float *b, size_t count);
}

PTEST_BEGIN("dsp.hmath", h_abs_dotp, 5, 5000)
PTEST_BEGIN("dsp.hmath", h_abs_dotp, 5, 2000)

void call(const char *label, float *a, float *b, size_t count, h_dotp_t func)
{
Expand Down
2 changes: 1 addition & 1 deletion src/test/ptest/hmath/h_abs_sum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace lsp
typedef float (* h_sum_t)(const float *src, size_t count);
}

PTEST_BEGIN("dsp.hmath", h_abs_sum, 5, 5000)
PTEST_BEGIN("dsp.hmath", h_abs_sum, 5, 2000)

void call(const char *label, float *src, size_t count, h_sum_t func)
{
Expand Down
2 changes: 1 addition & 1 deletion src/test/ptest/hmath/h_dotp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace lsp
typedef float (* h_dotp_t)(const float *a, const float *b, size_t count);
}

PTEST_BEGIN("dsp.hmath", h_dotp, 5, 5000)
PTEST_BEGIN("dsp.hmath", h_dotp, 5, 2000)

void call(const char *label, float *a, float *b, size_t count, h_dotp_t func)
{
Expand Down
2 changes: 1 addition & 1 deletion src/test/ptest/hmath/h_sqr_dotp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace lsp
typedef float (* h_dotp_t)(const float *a, const float *b, size_t count);
}

PTEST_BEGIN("dsp.hmath", h_sqr_dotp, 5, 5000)
PTEST_BEGIN("dsp.hmath", h_sqr_dotp, 5, 2000)

void call(const char *label, float *a, float *b, size_t count, h_dotp_t func)
{
Expand Down
2 changes: 1 addition & 1 deletion src/test/ptest/hmath/h_sqr_sum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace lsp
typedef float (* h_sum_t)(const float *src, size_t count);
}

PTEST_BEGIN("dsp.hmath", h_sqr_sum, 5, 5000)
PTEST_BEGIN("dsp.hmath", h_sqr_sum, 5, 2000)

void call(const char *label, float *src, size_t count, h_sum_t func)
{
Expand Down
2 changes: 1 addition & 1 deletion src/test/ptest/hmath/h_sum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace lsp
typedef float (* h_sum_t)(const float *src, size_t count);
}

PTEST_BEGIN("dsp.hmath", h_sum, 5, 5000)
PTEST_BEGIN("dsp.hmath", h_sum, 5, 2000)

void call(const char *label, float *src, size_t count, h_sum_t func)
{
Expand Down

0 comments on commit 81da281

Please sign in to comment.