compiler: add intrinsics for runtime/internal/sys functions

runtime/internal/sys.Ctz32/64 and Bswap32/64 are currently
implemented with compiler builtin functions. But if they are
called from another package, the compiler does not know and
therefore cannot turn them into compiler intrinsics. This CL
makes the compiler recognize these functions and turn them into
intrinsics directly, as the gc compiler does.

This CL sets up a way for adding intrinsics in the compiler.
More intrinsics will be added in later CLs.

Also move the handling of runtime.getcallerpc/sp to the new way
of generating intrinsics.

Change-Id: I1929f88327d9035beb860c8b1416198bf8527155
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/176917
Reviewed-by: Ian Lance Taylor <iant@golang.org>
6 files changed