]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: mask SLL,SRL,SRAconst shift amount
authorAlberto Donizetti <alb.donizetti@gmail.com>
Sat, 14 Nov 2020 12:33:32 +0000 (13:33 +0100)
committerAlberto Donizetti <alb.donizetti@gmail.com>
Mon, 16 Nov 2020 08:22:10 +0000 (08:22 +0000)
commitf2eea4c1dc37886939c010daff89c03d5a3825be
tree9eeabd7f0de4846ab536f7a9be4feb87fbdcb444
parent92c732e901a732855f4b813e6676264421eceae9
cmd/compile: mask SLL,SRL,SRAconst shift amount

mips SRA/SLL/SRL shift amounts are used mod 32; this change aligns the
XXXconst rules to mask the shift amount by &31.

Passes

  $ GOARCH=mips go build -toolexec 'toolstash -cmp' -a std
  $ GOARCH=mipsle go build -toolexec 'toolstash -cmp' -a std

Fixes #42587

Change-Id: I6003ebd0bc500fba4cf6fb10254e1b557bf8c48f
Reviewed-on: https://go-review.googlesource.com/c/go/+/270117
Trust: Alberto Donizetti <alb.donizetti@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/ssa/gen/MIPS.rules
src/cmd/compile/internal/ssa/gen/MIPSOps.go
src/cmd/compile/internal/ssa/rewriteMIPS.go
test/fixedbugs/issue42587.go [new file with mode: 0644]