From 685cb9af0d75377cd996780b9ff194b8d8739ade Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Tue, 13 Jul 2021 20:00:01 +0900 Subject: [PATCH] internal/cpu: Prefer XOR CX, CX over MOV 0, CX in xgetbv This makes the code consistent with the gccgo implementation. --- src/internal/cpu/cpu_x86.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal/cpu/cpu_x86.s b/src/internal/cpu/cpu_x86.s index 0df5da1cc74..49b625487e7 100644 --- a/src/internal/cpu/cpu_x86.s +++ b/src/internal/cpu/cpu_x86.s @@ -20,7 +20,7 @@ TEXT ·cpuid(SB), NOSPLIT, $0-24 // func xgetbv() (eax, edx uint32) TEXT ·xgetbv(SB),NOSPLIT,$0-8 - MOVL $0, CX + XORL CX, CX XGETBV MOVL AX, eax+0(FP) MOVL DX, edx+4(FP)