]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: instrinsify TrailingZeros{8,32,64} for 386
authorWayne Zuo <wdvxdr@golangcn.org>
Sun, 12 Mar 2023 07:34:20 +0000 (15:34 +0800)
committerWayne Zuo <wdvxdr@golangcn.org>
Tue, 14 Mar 2023 08:10:32 +0000 (08:10 +0000)
commitcedfcba3e859316410ae820abc5b43f9bda4e4f6
treed4c1a50114ca7ad23c30a74766a48eced8f23762
parent82bf12902f2abecdbe2cb5fa38299ac70cf9c67e
cmd/compile: instrinsify TrailingZeros{8,32,64} for 386

This CL add support for instrinsifying the TrialingZeros{8,32,64}
functions for 386 architecture. We need handle the case when the input
is 0, which could lead to undefined output from the BSFL instruction.

Next CL will remove the assembly code in runtime/internal/sys package.

Change-Id: Ic168edf68e81bf69a536102100fdd3f56f0f4a1b
Reviewed-on: https://go-review.googlesource.com/c/go/+/475735
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Wayne Zuo <wdvxdr@golangcn.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/compile/internal/ssa/_gen/386.rules
src/cmd/compile/internal/ssa/_gen/386Ops.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewrite386.go
src/cmd/compile/internal/ssagen/ssa.go
src/cmd/compile/internal/x86/ssa.go
test/codegen/mathbits.go