Skip to content

Commit

Permalink
s2: Fix GOAMD64_v3 (#492)
Browse files Browse the repository at this point in the history
There is no #elifdef - it just seems to be ignored.
Use workaround for emitting.
  • Loading branch information
klauspost committed Feb 12, 2022
1 parent 733534c commit 91d9d32
Show file tree
Hide file tree
Showing 2 changed files with 286 additions and 32 deletions.
8 changes: 7 additions & 1 deletion s2/_generate/gen.go
Expand Up @@ -2507,8 +2507,14 @@ func (o options) matchLen(name string, a, b, len reg.GPVirtual, end LabelRef) re
// 2016 BMI :TZCNT r64, r64 L: 0.57ns= 2.0c T: 0.29ns= 1.00c
// 315 AMD64 :BSF r64, r64 L: 0.88ns= 3.1c T: 0.86ns= 3.00c
TZCNTQ(tmp, tmp)
Comment("#elifdef GOAMD64_v4")
Comment("#define TZCNTQ_EMITTED 1")
Comment("#endif\n")
Comment("#ifdef GOAMD64_v4")
TZCNTQ(tmp, tmp)
Comment("#define TZCNTQ_EMITTED 1")
Comment("#endif\n")
Comment("#ifdef TZCNTQ_EMITTED")
Comment("#undef TZCNTQ_EMITTED")
Comment("#else")
BSFQ(tmp, tmp)
Comment("#endif")
Expand Down

0 comments on commit 91d9d32

Please sign in to comment.