Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use sse instead of sse4 #305

Merged
merged 3 commits into from Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.