]> Cypherpunks repositories - gostls13.git/commitdiff
all: align cpu feature variable offset naming
authorMartin Möhrmann <moehrmann@google.com>
Fri, 24 Aug 2018 09:02:00 +0000 (11:02 +0200)
committerMartin Möhrmann <moehrmann@google.com>
Fri, 24 Aug 2018 18:40:16 +0000 (18:40 +0000)
Add an "offset_" prefix to all cpu feature variable offset constants to
signify that they are not boolean cpu feature variables.

Remove _ from offset constant names.

Change-Id: I6e22a79ebcbe6e2ae54c4ac8764f9260bb3223ff
Reviewed-on: https://go-review.googlesource.com/131215
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
15 files changed:
src/internal/bytealg/bytealg.go
src/internal/bytealg/compare_amd64.s
src/internal/bytealg/count_amd64.s
src/internal/bytealg/equal_386.s
src/internal/bytealg/equal_amd64.s
src/internal/bytealg/index_amd64.s
src/internal/bytealg/indexbyte_amd64.s
src/internal/bytealg/indexbyte_s390x.s
src/runtime/asm_386.s
src/runtime/cpuflags.go
src/runtime/memclr_386.s
src/runtime/memclr_amd64.s
src/runtime/memmove_386.s
src/runtime/memmove_amd64.s
src/runtime/vlop_arm.s

index 1ab7c30f4ea00aa7bbbae6956fbd65698d322bc5..9ecd8eb004b03b3ddee99804a3c15ebd3d931e15 100644 (file)
@@ -11,11 +11,12 @@ import (
 
 // Offsets into internal/cpu records for use in assembly.
 const (
-       x86_HasSSE2   = unsafe.Offsetof(cpu.X86.HasSSE2)
-       x86_HasSSE42  = unsafe.Offsetof(cpu.X86.HasSSE42)
-       x86_HasAVX2   = unsafe.Offsetof(cpu.X86.HasAVX2)
-       x86_HasPOPCNT = unsafe.Offsetof(cpu.X86.HasPOPCNT)
-       s390x_HasVX   = unsafe.Offsetof(cpu.S390X.HasVX)
+       offsetX86HasSSE2   = unsafe.Offsetof(cpu.X86.HasSSE2)
+       offsetX86HasSSE42  = unsafe.Offsetof(cpu.X86.HasSSE42)
+       offsetX86HasAVX2   = unsafe.Offsetof(cpu.X86.HasAVX2)
+       offsetX86HasPOPCNT = unsafe.Offsetof(cpu.X86.HasPOPCNT)
+
+       offsetS390xHasVX = unsafe.Offsetof(cpu.S390X.HasVX)
 )
 
 // MaxLen is the maximum length of the string to be searched for (argument b) in Index.
index 277d77c545ada408b76f80de05b9a2413bae0172..05bef4aad938fc52ffa34c21bb26b672c266dd4d 100644 (file)
@@ -47,7 +47,7 @@ TEXT cmpbody<>(SB),NOSPLIT,$0-0
 
        CMPQ    R8, $63
        JBE     loop
-       CMPB    internal∕cpu·X86+const_x86_HasAVX2(SB), $1
+       CMPB    internal∕cpu·X86+const_offsetX86HasAVX2(SB), $1
        JEQ     big_loop_avx2
        JMP     big_loop
 loop:
index cecba11cf9ff08b1b43722f4ec0a63d344ae656e..fa864c4c76631d8d83b89f92c913ffd55d1430ee 100644 (file)
@@ -6,7 +6,7 @@
 #include "textflag.h"
 
 TEXT ·Count(SB),NOSPLIT,$0-40
-       CMPB    internal∕cpu·X86+const_x86_HasPOPCNT(SB), $1
+       CMPB    internal∕cpu·X86+const_offsetX86HasPOPCNT(SB), $1
        JEQ     2(PC)
        JMP     ·countGeneric(SB)
        MOVQ    b_base+0(FP), SI
@@ -16,7 +16,7 @@ TEXT ·Count(SB),NOSPLIT,$0-40
        JMP     countbody<>(SB)
 
 TEXT ·CountString(SB),NOSPLIT,$0-32
-       CMPB    internal∕cpu·X86+const_x86_HasPOPCNT(SB), $1
+       CMPB    internal∕cpu·X86+const_offsetX86HasPOPCNT(SB), $1
        JEQ     2(PC)
        JMP     ·countGenericString(SB)
        MOVQ    s_base+0(FP), SI
@@ -151,7 +151,7 @@ endofpage:
        RET
 
 avx2:
-       CMPB   internal∕cpu·X86+const_x86_HasAVX2(SB), $1
+       CMPB   internal∕cpu·X86+const_offsetX86HasAVX2(SB), $1
        JNE sse
        MOVD AX, X0
        LEAQ -32(SI)(BX*1), R11
index c048b6cebc87c8a631bc4496ed370968cbbed777..273389284ef12b98f12258e9011e22b849d7a2cd 100644 (file)
@@ -80,7 +80,7 @@ TEXT memeqbody<>(SB),NOSPLIT,$0-0
 hugeloop:
        CMPL    BX, $64
        JB      bigloop
-       CMPB    internal∕cpu·X86+const_x86_HasSSE2(SB), $1
+       CMPB    internal∕cpu·X86+const_offsetX86HasSSE2(SB), $1
        JNE     bigloop
        MOVOU   (SI), X0
        MOVOU   (DI), X1
index cbc62dc1d8f3da6cab0d4dadd09e4ae036240ebb..5263d3040d56176450a9762c3ad9a7ba7e2b70a8 100644 (file)
@@ -77,7 +77,7 @@ TEXT memeqbody<>(SB),NOSPLIT,$0-0
        JB      small
        CMPQ    BX, $64
        JB      bigloop
-       CMPB    internal∕cpu·X86+const_x86_HasAVX2(SB), $1
+       CMPB    internal∕cpu·X86+const_offsetX86HasAVX2(SB), $1
        JE      hugeloop_avx2
        
        // 64 bytes at a time using xmm registers
index f7297c0cab4eb3ab1a78f477be861348279754f0..4459820801082efa47ed2d8e6b73c99c2962899c 100644 (file)
@@ -233,7 +233,7 @@ success_avx2:
        VZEROUPPER
        JMP success
 sse42:
-       CMPB internal∕cpu·X86+const_x86_HasSSE42(SB), $1
+       CMPB internal∕cpu·X86+const_offsetX86HasSSE42(SB), $1
        JNE no_sse42
        CMPQ AX, $12
        // PCMPESTRI is slower than normal compare,
index 359f38904b1d3d4fa5a90332d7dc9affdeabbf6a..5bf8866476379d0df52127c6d856368feb717bde 100644 (file)
@@ -139,7 +139,7 @@ endofpage:
        RET
 
 avx2:
-       CMPB   internal∕cpu·X86+const_x86_HasAVX2(SB), $1
+       CMPB   internal∕cpu·X86+const_offsetX86HasAVX2(SB), $1
        JNE sse
        MOVD AX, X0
        LEAQ -32(SI)(BX*1), R11
index 15fd2935b4a9e9bba16ed55d914486b573011463..24f5ce17fa00ec815c3e1bf18d3614a8d11a3ed0 100644 (file)
@@ -64,7 +64,7 @@ notfound:
        RET
 
 large:
-       MOVBZ   internal∕cpu·S390X+const_s390x_HasVX(SB), R1
+       MOVBZ   internal∕cpu·S390X+const_offsetS390xHasVX(SB), R1
        CMPBNE  R1, $0, vectorimpl
 
 srstimpl:                       // no vector facility
index 725271eec4debcc24453c26c904bb0a01d51403f..7761415ecd5b718b92eea0a3508f86263294927f 100644 (file)
@@ -881,7 +881,7 @@ TEXT runtime·stackcheck(SB), NOSPLIT, $0-0
 
 // func cputicks() int64
 TEXT runtime·cputicks(SB),NOSPLIT,$0-8
-       CMPB    internal∕cpu·X86+const_offset_x86_HasSSE2(SB), $1
+       CMPB    internal∕cpu·X86+const_offsetX86HasSSE2(SB), $1
        JNE     done
        CMPB    runtime·lfenceBeforeRdtsc(SB), $1
        JNE     mfence
index 050168c2d730330a74435f15df26d22aadc8813a..b65523766af5f79d10022ccc4de7d757d16a8ef8 100644 (file)
@@ -11,9 +11,9 @@ import (
 
 // Offsets into internal/cpu records for use in assembly.
 const (
-       offset_x86_HasAVX2 = unsafe.Offsetof(cpu.X86.HasAVX2)
-       offset_x86_HasERMS = unsafe.Offsetof(cpu.X86.HasERMS)
-       offset_x86_HasSSE2 = unsafe.Offsetof(cpu.X86.HasSSE2)
+       offsetX86HasAVX2 = unsafe.Offsetof(cpu.X86.HasAVX2)
+       offsetX86HasERMS = unsafe.Offsetof(cpu.X86.HasERMS)
+       offsetX86HasSSE2 = unsafe.Offsetof(cpu.X86.HasSSE2)
 
-       offset_arm_HasIDIVA = unsafe.Offsetof(cpu.ARM.HasIDIVA)
+       offsetARMHasIDIVA = unsafe.Offsetof(cpu.ARM.HasIDIVA)
 )
index 318f8839640e26ee93ad274bc1839c832e32c31b..65f7196312cec0fa6d3aa758f2b61b573013b2a0 100644 (file)
@@ -29,7 +29,7 @@ tail:
        JBE     _5through8
        CMPL    BX, $16
        JBE     _9through16
-       CMPB    internal∕cpu·X86+const_offset_x86_HasSSE2(SB), $1
+       CMPB    internal∕cpu·X86+const_offsetX86HasSSE2(SB), $1
        JNE     nosse2
        PXOR    X0, X0
        CMPL    BX, $32
index b64b1477f9365ba37f03c6c016b5cf798ca3e6fc..d79078fd00bf5f389837603ad1c40fda72b20c18 100644 (file)
@@ -38,7 +38,7 @@ tail:
        JBE     _65through128
        CMPQ    BX, $256
        JBE     _129through256
-       CMPB    internal∕cpu·X86+const_offset_x86_HasAVX2(SB), $1
+       CMPB    internal∕cpu·X86+const_offsetX86HasAVX2(SB), $1
        JE loop_preheader_avx2
        // TODO: for really big clears, use MOVNTDQ, even without AVX2.
 
index 85c622b6b6283a645e08058b5fb4cc43d5336602..7b54070f595cc0696ff37b3b3d7e5ec9ca3cb38f 100644 (file)
@@ -52,7 +52,7 @@ tail:
        JBE     move_5through8
        CMPL    BX, $16
        JBE     move_9through16
-       CMPB    internal∕cpu·X86+const_offset_x86_HasSSE2(SB), $1
+       CMPB    internal∕cpu·X86+const_offsetX86HasSSE2(SB), $1
        JNE     nosse2
        CMPL    BX, $32
        JBE     move_17through32
@@ -73,7 +73,7 @@ nosse2:
  */
 forward:
        // If REP MOVSB isn't fast, don't use it
-       CMPB    internal∕cpu·X86+const_offset_x86_HasERMS(SB), $1 // enhanced REP MOVSB/STOSB
+       CMPB    internal∕cpu·X86+const_offsetX86HasERMS(SB), $1 // enhanced REP MOVSB/STOSB
        JNE     fwdBy4
 
        // Check alignment
index c5385a3d4368a7c2e62eda9f67f53ecb8f1d6552..b4243a833b6e6293051e444dfedebe62aa6223a2 100644 (file)
@@ -84,7 +84,7 @@ forward:
        JLS     move_256through2048
 
        // If REP MOVSB isn't fast, don't use it
-       CMPB    internal∕cpu·X86+const_offset_x86_HasERMS(SB), $1 // enhanced REP MOVSB/STOSB
+       CMPB    internal∕cpu·X86+const_offsetX86HasERMS(SB), $1 // enhanced REP MOVSB/STOSB
        JNE     fwdBy8
 
        // Check alignment
index 8df13abd988202711fa158a5d566c18ff3d4b3df..729653488ffd01ad89b899752a823be103ab9217 100644 (file)
@@ -44,7 +44,7 @@
 // the RET instruction will clobber R12 on nacl, and the compiler's register
 // allocator needs to know.
 TEXT runtime·udiv(SB),NOSPLIT|NOFRAME,$0
-       MOVBU   internal∕cpu·ARM+const_offset_arm_HasIDIVA(SB), Ra
+       MOVBU   internal∕cpu·ARM+const_offsetARMHasIDIVA(SB), Ra
        CMP     $0, Ra
        BNE     udiv_hardware