Skip to content

Commit

Permalink
fix: use sse instead of sse4 (#305)
Browse files Browse the repository at this point in the history
* fix: use sse instead of sse4

* fix: use dispatch

* fix: remove lzero

Co-authored-by: liuqiang <liuqiang.06@bytedance.com>
  • Loading branch information
liuq19 and liuq19 committed Sep 26, 2022
1 parent 5e54c02 commit 56e81a6
Show file tree
Hide file tree
Showing 20 changed files with 8,748 additions and 11,357 deletions.
16 changes: 8 additions & 8 deletions Makefile
Expand Up @@ -14,22 +14,22 @@
# limitations under the License.
#

ARCH := avx avx2 sse4
ARCH := avx avx2 sse
TMP_DIR := output
OUT_DIR := internal/native
SRC_FILE := native/native.c

CPU_avx := amd64
CPU_avx2 := amd64
CPU_sse4 := amd64
CPU_sse := amd64

TMPL_avx := fastint_amd64_test fastfloat_amd64_test native_amd64_test native_export_amd64
TMPL_avx2 := fastint_amd64_test fastfloat_amd64_test native_amd64_test native_export_amd64
TMPL_sse4 := fastint_amd64_test fastfloat_amd64_test native_amd64_test native_export_amd64
TMPL_sse := fastint_amd64_test fastfloat_amd64_test native_amd64_test native_export_amd64

CFLAGS_avx := -msse4 -mavx -mno-avx2 -DUSE_AVX=1 -DUSE_AVX2=0
CFLAGS_avx2 := -msse4 -mavx -mavx2 -DUSE_AVX=1 -DUSE_AVX2=1
CFLAGS_sse4 := -msse4 -mno-avx -mno-avx2
CFLAGS_avx := -msse -mno-sse4 -mavx -mno-avx2 -DUSE_AVX=1 -DUSE_AVX2=0
CFLAGS_avx2 := -msse -mno-sse4 -mavx -mavx2 -DUSE_AVX=1 -DUSE_AVX2=1
CFLAGS_sse := -msse -mno-sse4 -mno-avx -mno-avx2

CC_amd64 := clang
ASM2ASM_amd64 := tools/asm2asm/asm2asm.py
Expand Down Expand Up @@ -100,8 +100,8 @@ endef
all: ${ARCH}

clean:
rm -vfr ${TMP_DIR}/{sse4,avx,avx2}
rm -vfr ${OUT_DIR}/{sse4,avx,avx2}
rm -vfr ${TMP_DIR}/{sse,avx,avx2}
rm -vfr ${OUT_DIR}/{sse,avx,avx2}

$(foreach \
arch, \
Expand Down
2 changes: 1 addition & 1 deletion internal/cpu/features.go
Expand Up @@ -26,7 +26,7 @@ import (
var (
HasAVX = cpuid.CPU.Has(cpuid.AVX)
HasAVX2 = cpuid.CPU.Has(cpuid.AVX2)
HasSSE4 = cpuid.CPU.Has(cpuid.SSE4)
HasSSE = cpuid.CPU.Has(cpuid.SSE)
)

func init() {
Expand Down
5 changes: 0 additions & 5 deletions internal/native/avx/native_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6,400 changes: 2,781 additions & 3,619 deletions internal/native/avx/native_amd64.s

Large diffs are not rendered by default.

44 changes: 20 additions & 24 deletions internal/native/avx/native_subr_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions internal/native/avx2/native_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 56e81a6

Please sign in to comment.