summaryrefslogtreecommitdiff
path: root/test/escape_closure.go
diff options
context:
space:
mode:
authorMark Ryan <mark.d.ryan@intel.com>2019-03-18 15:48:34 +0100
committerIlya Tocar <ilya.tocar@intel.com>2019-04-02 16:25:30 +0000
commit4ebc6514faa8530d1a68b4e04f57dc5c25bcb01c (patch)
treeb89bc9665cda30cfc1f0adcdbba7067e260d7455 /test/escape_closure.go
parent3aacfce6cf7e5f0346906e5236433852f4075368 (diff)
downloadgo-git-4ebc6514faa8530d1a68b4e04f57dc5c25bcb01c.tar.gz
cmd/asm: Fix EVEX RIP-relative addressing
AVX-512 instructions that use RIP-relative addressing and require the R bit of the EVEX prefix to be zero, i.e., instructions that use Z8-Z15 or Z24-Z31, are incorrectly encoded by the assembler. The reason is that the location of the offset at which the relative address is to be written is incorrectly computed when the R bit is clear. For example, VMOVUPS bInitX<>+0(SB), Z0 encodes correctly to 62 f1 7c 48 10 05 66 e9 02 00 whereas VMOVUPS bInitX<>+0(SB), Z8 encodes incorrectly to 62 71 7c 48 10 05 00 56 e9 02 00 Note the extra zero byte between the ModR/M byte (05) and the relative address starting with 56. This error results in the first byte of the following instruction being overwritten and typically, a program crash. This commit fixes the issue in the same way that is fixed for VEX encoded instructions, by simply not incrementing the offset for EVEX instructions. Existing test code created for a similar VEX encoding issue (19518) has been modified to also test for the issue addressed by this commit. Fixes #31001 Change-Id: If84719ac22ebb5fb3c42ff96cd32b611ad497414 Reviewed-on: https://go-review.googlesource.com/c/go/+/168562 Run-TryBot: Ilya Tocar <ilya.tocar@intel.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
Diffstat (limited to 'test/escape_closure.go')
0 files changed, 0 insertions, 0 deletions