• isharipo's avatar
    cmd/internal/obj/x86: fix /is4 encoding for VBLEND · 49322ca9
    isharipo authored
    Fixes VBLENDVP{D/S}, VPBLENDVB encoding for /is4 imm8[7:4]
    encoded register operand.
    
    Explanation:
    `reg[r]+regrex[r]+1` will yield correct values for 8..15 reg indexes,
    but for 0..7 it gives `index+1` results.
    There was no test that used lower 8 register with /is4 encoding,
    so the bug passed the tests.
    The proper solution is to get 4th bit from regrex with a proper shift:
    `reg[r]|(regrex[r]<<1)`.
    
    Instead of inlining `reg[r]|(regrex[r]<<1)` expr,
    using new `regIndex(r)` function.
    
    Test that reproduces this issue is added to
    amd64enc_extra.s test suite.
    
    Bug came from https://golang.org/cl/70650.
    
    Change-Id: I846a25e88d5e6df88df9d9c3f5fe94ec55416a33
    Reviewed-on: https://go-review.googlesource.com/78815
    Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarIlya Tocar <ilya.tocar@intel.com>
    49322ca9
Name
Last commit
Last update
..
arm Loading commit data...
arm64 Loading commit data...
mips Loading commit data...
ppc64 Loading commit data...
s390x Loading commit data...
x86 Loading commit data...
addrtype_string.go Loading commit data...
bootstrap.go Loading commit data...
data.go Loading commit data...
go.go Loading commit data...
inl.go Loading commit data...
ld.go Loading commit data...
line.go Loading commit data...
line_test.go Loading commit data...
link.go Loading commit data...
objfile.go Loading commit data...
pass.go Loading commit data...
pcln.go Loading commit data...
plist.go Loading commit data...
sizeof_test.go Loading commit data...
sort.go Loading commit data...
stringer.go Loading commit data...
sym.go Loading commit data...
textflag.go Loading commit data...
util.go Loading commit data...