aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/asm_386.s
diff options
context:
space:
mode:
authorisharipo <iskander.sharipov@intel.com>2018-03-19 23:07:18 +0300
committerIlya Tocar <ilya.tocar@intel.com>2018-03-21 20:51:04 +0000
commitff5cf43df5b1614f940157b21ca6ed64791b8a1f (patch)
tree7ce052bcf4b4c33efa32c7207f15cadd77a27168 /src/runtime/asm_386.s
parent65727ab59d20663a76692fea7b8444dbb349080b (diff)
downloadgo-ff5cf43df5b1614f940157b21ca6ed64791b8a1f.tar.gz
go-ff5cf43df5b1614f940157b21ca6ed64791b8a1f.zip
runtime,sync/atomic: replace asm BYTEs with insts for x86
For each replacement, test case is added to new 386enc.s file with exception of EMMS, SYSENTER, MFENCE and LFENCE as they are already covered in amd64enc.s (same on amd64 and 386). The replacement became less obvious after go vet suggested changes Before: BYTE $0x0f; BYTE $0x7f; BYTE $0x44; BYTE $0x24; BYTE $0x08 Changed to MOVQ (this form is being tested): MOVQ M0, 8(SP) Refactored to FP-relative access (go vet advice): MOVQ M0, val+4(FP) Change-Id: I56b87cf3371b6ad81ad0cd9db2033aee407b5818 Reviewed-on: https://go-review.googlesource.com/101475 Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
Diffstat (limited to 'src/runtime/asm_386.s')
-rw-r--r--src/runtime/asm_386.s4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/asm_386.s b/src/runtime/asm_386.s
index f565bb305d..8b706f6706 100644
--- a/src/runtime/asm_386.s
+++ b/src/runtime/asm_386.s
@@ -930,10 +930,10 @@ TEXT runtime·cputicks(SB),NOSPLIT,$0-8
JNE done
CMPB runtime·lfenceBeforeRdtsc(SB), $1
JNE mfence
- BYTE $0x0f; BYTE $0xae; BYTE $0xe8 // LFENCE
+ LFENCE
JMP done
mfence:
- BYTE $0x0f; BYTE $0xae; BYTE $0xf0 // MFENCE
+ MFENCE
done:
RDTSC
MOVL AX, ret_lo+0(FP)