It's because in general the compiler internally implements all the
functions that appear in runtime/internal/atomic. The implementations
in that package are not normally used at all, though they may be used
when optimizations are disabled (-gcflags=-N). For the internal
compiler implementations you can start by looking for
OpAtomicCompareAndSwap32 in cmd/compile/internal/ssa.
Ian