diff options
| author | Joel Sing <joel@sing.id.au> | 2023-04-07 06:15:59 +1000 |
|---|---|---|
| committer | Joel Sing <joel@sing.id.au> | 2023-04-11 18:32:50 +0000 |
| commit | 05cd6cbb98a78f04fcfe018527fc8a50364bd0ee (patch) | |
| tree | ada47d4e5878ead735b6c428720ceffc28a5ab0c /src/cmd/asm | |
| parent | 0d82f584c223fb045496f3e063bf93416a24e0b0 (diff) | |
| download | go-05cd6cbb98a78f04fcfe018527fc8a50364bd0ee.tar.xz | |
cmd/asm,cmd/internal/obj/x86: add RDPID instruction to x86 assembler
Add support for the Read Processor ID (RDPID) instruction to the x86
assembler. This returns the current logical processor's ID in the
specified register, as a faster alternative to RDTSCP.
Fixes #56525
Change-Id: I43482e42431dfc385ce2e7f6d44b9746b0cc4548
Reviewed-on: https://go-review.googlesource.com/c/go/+/482955
Run-TryBot: Joel Sing <joel@sing.id.au>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Diffstat (limited to 'src/cmd/asm')
| -rw-r--r-- | src/cmd/asm/internal/asm/testdata/386enc.s | 3 | ||||
| -rw-r--r-- | src/cmd/asm/internal/asm/testdata/amd64enc_extra.s | 4 | ||||
| -rw-r--r-- | src/cmd/asm/internal/asm/testdata/amd64error.s | 3 |
3 files changed, 10 insertions, 0 deletions
diff --git a/src/cmd/asm/internal/asm/testdata/386enc.s b/src/cmd/asm/internal/asm/testdata/386enc.s index 4af6de36d1..aacb40793e 100644 --- a/src/cmd/asm/internal/asm/testdata/386enc.s +++ b/src/cmd/asm/internal/asm/testdata/386enc.s @@ -33,5 +33,8 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0 PUSHL FS // 0fa0 POPL FS // 0fa1 POPL SS // 17 + + RDPID AX // f30fc7f8 + // End of tests. RET diff --git a/src/cmd/asm/internal/asm/testdata/amd64enc_extra.s b/src/cmd/asm/internal/asm/testdata/amd64enc_extra.s index 48bdf1bcda..08cb20c707 100644 --- a/src/cmd/asm/internal/asm/testdata/amd64enc_extra.s +++ b/src/cmd/asm/internal/asm/testdata/amd64enc_extra.s @@ -1055,5 +1055,9 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0 TPAUSE BX // 660faef3 UMONITOR BX // f30faef3 UMWAIT BX // f20faef3 + + RDPID DX // f30fc7fa + RDPID R11 // f3410fc7fb + // End of tests. RET diff --git a/src/cmd/asm/internal/asm/testdata/amd64error.s b/src/cmd/asm/internal/asm/testdata/amd64error.s index 5bd335e303..1ca2d3147c 100644 --- a/src/cmd/asm/internal/asm/testdata/amd64error.s +++ b/src/cmd/asm/internal/asm/testdata/amd64error.s @@ -144,4 +144,7 @@ TEXT errors(SB),$0 VMOVDQA32.Z Z0, Z1 // ERROR "mask register must be specified for .Z instructions" VMOVDQA32.Z Z0, K0, Z1 // ERROR "invalid instruction" VMOVDQA32.Z Z0, K1, Z1 // ok + + RDPID (BX) // ERROR "invalid instruction" + RET |
