mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: use unsigned loads for multi-element comparisons
When loading multiple elements of an array into a single register, make sure we treat them as unsigned. When treated as signed, the upper bits might all be set, causing the shift-or combo to clobber the values higher in the register. Fixes #23719. Change-Id: Ic87da03e9bd0fe2c60bb214b99f846e4e9446052 Reviewed-on: https://go-review.googlesource.com/92335 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
This commit is contained in:
parent
85bdd05c05
commit
23e8e197b0
3 changed files with 62 additions and 1 deletions
|
|
@ -1002,6 +1002,20 @@ var linuxAMD64Tests = []*asmTest{
|
|||
}`,
|
||||
pos: []string{"\tCMPL\t[A-Z]"},
|
||||
},
|
||||
{
|
||||
fn: `
|
||||
func $(a,b [3]int16) bool {
|
||||
return a == b
|
||||
}`,
|
||||
pos: []string{"\tCMPL\t[A-Z]"},
|
||||
},
|
||||
{
|
||||
fn: `
|
||||
func $(a,b [12]int8) bool {
|
||||
return a == b
|
||||
}`,
|
||||
pos: []string{"\tCMPQ\t[A-Z]", "\tCMPL\t[A-Z]"},
|
||||
},
|
||||
{
|
||||
fn: `
|
||||
func f70(a,b [15]byte) bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue