aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/x86
diff options
context:
space:
mode:
authorMichele Di Pede <michele.di.pede@gmail.com>2020-10-30 11:55:18 +0100
committerKeith Randall <khr@golang.org>2020-10-30 19:48:57 +0000
commit94b3fd06cb431358f45786246cd279c8bdb9370b (patch)
tree3ee4e87368a5aa793e7bd40a7a779b082a0dda77 /src/cmd/compile/internal/x86
parent7191f1136b1526703c5af7fc04ff948e3a6c26b9 (diff)
downloadgo-94b3fd06cb431358f45786246cd279c8bdb9370b.tar.gz
go-94b3fd06cb431358f45786246cd279c8bdb9370b.zip
cmd/compile: code cleanup
Change-Id: Ibf68e663f29a5cb3b64a7d923c005c16da647769 Reviewed-on: https://go-review.googlesource.com/c/go/+/266537 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/x86')
-rw-r--r--src/cmd/compile/internal/x86/ssa.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/cmd/compile/internal/x86/ssa.go b/src/cmd/compile/internal/x86/ssa.go
index 74a4570770..fbf76d0c5e 100644
--- a/src/cmd/compile/internal/x86/ssa.go
+++ b/src/cmd/compile/internal/x86/ssa.go
@@ -42,10 +42,11 @@ func ssaMarkMoves(s *gc.SSAGenState, b *ssa.Block) {
// loadByType returns the load instruction of the given type.
func loadByType(t *types.Type) obj.As {
// Avoid partial register write
- if !t.IsFloat() && t.Size() <= 2 {
- if t.Size() == 1 {
+ if !t.IsFloat() {
+ switch t.Size() {
+ case 1:
return x86.AMOVBLZX
- } else {
+ case 2:
return x86.AMOVWLZX
}
}