]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: added some intrinsics to SSA back end
authorDavid Chase <drchase@google.com>
Fri, 11 Mar 2016 05:10:52 +0000 (00:10 -0500)
committerDavid Chase <drchase@google.com>
Mon, 28 Mar 2016 16:29:59 +0000 (16:29 +0000)
commit8eec2bbfbc4f209950f677906c6ce67e01d32930
treed7262de9875b76be2e91785823375865b230324c
parent2e90192b0e774f44a2d918509e0bd32823ce5c2c
cmd/compile: added some intrinsics to SSA back end

One intrinsic was needed to help get the very best
performance out of a future GC; as long as that one was
being added, I also added Bswap since that is sometimes
a handy thing to have.  I had intended to fill out the
bit-scan intrinsic family, but the mismatch between the
"scan forward" instruction and "count leading zeroes"
was large enough to cause me to leave it out -- it poses
a dilemma that I'd rather dodge right now.

These intrinsics are not exposed for general use.
That's a separate issue requiring an API proposal change
( https://github.com/golang/proposal )

All intrinsics are tested, both that they are substituted
on the appropriate architecture, and that they produce the
expected result.

Change-Id: I5848037cfd97de4f75bdc33bdd89bba00af4a8ee
Reviewed-on: https://go-review.googlesource.com/20564
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
15 files changed:
src/cmd/compile/internal/amd64/prog.go
src/cmd/compile/internal/amd64/ssa.go
src/cmd/compile/internal/gc/go.go
src/cmd/compile/internal/gc/inl.go
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/ssa/compile.go
src/cmd/compile/internal/ssa/gen/AMD64.rules
src/cmd/compile/internal/ssa/gen/AMD64Ops.go
src/cmd/compile/internal/ssa/gen/genericOps.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/rewriteAMD64.go
src/runtime/internal/sys/intrinsics.go [new file with mode: 0644]
test/intrinsic.dir/main.go [new file with mode: 0644]
test/intrinsic.go [new file with mode: 0644]
test/run.go