runtime: use a fence instruction before rdtsc
authorIan Lance Taylor <ian@gcc.gnu.org>
Wed, 7 Mar 2018 14:31:03 +0000 (14:31 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 7 Mar 2018 14:31:03 +0000 (14:31 +0000)
commit2dab5d909f20be950c35ab4767ba1e0b64cb6bbc
treea2f3871cade9720ac021f8cdb38d3be3270e83be
parent6cde8c545b8a300409863c70526189d3f7f659df
runtime: use a fence instruction before rdtsc

    This implements the same choices made in the gc runtime, except that
    for 32-bit x86 we only use the fence instruction if the processor
    supports SSE2.

    The code here is hacked up for speed; the gc runtime uses straight
    assembler.

    Reviewed-on: https://go-review.googlesource.com/97715

From-SVN: r258336
gcc/go/gofrontend/MERGE
libgo/runtime/runtime_c.c