]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/internal/obj/arm: cleanup some unnecessary temps and conversions
authorMatthew Dempsky <mdempsky@google.com>
Thu, 29 Sep 2016 18:00:47 +0000 (11:00 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 29 Sep 2016 18:14:05 +0000 (18:14 +0000)
Change-Id: I573278c9aee80e62463b2542774dabeec7c3b098
Reviewed-on: https://go-review.googlesource.com/29969
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/internal/obj/arm/asm5.go

index c47863db471c7f3be34bc6b34a9a25cec7fdacc0..a1213bcfb8346d27401c28969e92c545e2f74fea 100644 (file)
@@ -1026,16 +1026,15 @@ func aclass(ctxt *obj.Link, a *obj.Addr) int {
 
                case obj.NAME_AUTO:
                        ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset
-                       t := int(immaddr(int32(ctxt.Instoffset)))
-                       if t != 0 {
+                       if t := immaddr(int32(ctxt.Instoffset)); t != 0 {
                                if immhalf(int32(ctxt.Instoffset)) {
-                                       if immfloat(int32(t)) {
+                                       if immfloat(t) {
                                                return C_HFAUTO
                                        }
                                        return C_HAUTO
                                }
 
-                               if immfloat(int32(t)) {
+                               if immfloat(t) {
                                        return C_FAUTO
                                }
                                return C_SAUTO
@@ -1045,16 +1044,15 @@ func aclass(ctxt *obj.Link, a *obj.Addr) int {
 
                case obj.NAME_PARAM:
                        ctxt.Instoffset = int64(ctxt.Autosize) + a.Offset + 4
-                       t := int(immaddr(int32(ctxt.Instoffset)))
-                       if t != 0 {
+                       if t := immaddr(int32(ctxt.Instoffset)); t != 0 {
                                if immhalf(int32(ctxt.Instoffset)) {
-                                       if immfloat(int32(t)) {
+                                       if immfloat(t) {
                                                return C_HFAUTO
                                        }
                                        return C_HAUTO
                                }
 
-                               if immfloat(int32(t)) {
+                               if immfloat(t) {
                                        return C_FAUTO
                                }
                                return C_SAUTO
@@ -1064,20 +1062,18 @@ func aclass(ctxt *obj.Link, a *obj.Addr) int {
 
                case obj.NAME_NONE:
                        ctxt.Instoffset = a.Offset
-                       t := int(immaddr(int32(ctxt.Instoffset)))
-                       if t != 0 {
+                       if t := immaddr(int32(ctxt.Instoffset)); t != 0 {
                                if immhalf(int32(ctxt.Instoffset)) { /* n.b. that it will also satisfy immrot */
-                                       if immfloat(int32(t)) {
+                                       if immfloat(t) {
                                                return C_HFOREG
                                        }
                                        return C_HOREG
                                }
 
-                               if immfloat(int32(t)) {
+                               if immfloat(t) {
                                        return C_FOREG /* n.b. that it will also satisfy immrot */
                                }
-                               t := int(immrot(uint32(ctxt.Instoffset)))
-                               if t != 0 {
+                               if immrot(uint32(ctxt.Instoffset)) != 0 {
                                        return C_SROREG
                                }
                                if immhalf(int32(ctxt.Instoffset)) {
@@ -1086,8 +1082,7 @@ func aclass(ctxt *obj.Link, a *obj.Addr) int {
                                return C_SOREG
                        }
 
-                       t = int(immrot(uint32(ctxt.Instoffset)))
-                       if t != 0 {
+                       if immrot(uint32(ctxt.Instoffset)) != 0 {
                                return C_ROREG
                        }
                        return C_LOREG
@@ -1116,12 +1111,10 @@ func aclass(ctxt *obj.Link, a *obj.Addr) int {
                                return aconsize(ctxt)
                        }
 
-                       t := int(immrot(uint32(ctxt.Instoffset)))
-                       if t != 0 {
+                       if immrot(uint32(ctxt.Instoffset)) != 0 {
                                return C_RCON
                        }
-                       t = int(immrot(^uint32(ctxt.Instoffset)))
-                       if t != 0 {
+                       if immrot(^uint32(ctxt.Instoffset)) != 0 {
                                return C_NCON
                        }
                        return C_LCON
@@ -1155,10 +1148,10 @@ func aclass(ctxt *obj.Link, a *obj.Addr) int {
 }
 
 func aconsize(ctxt *obj.Link) int {
-       if t := int(immrot(uint32(ctxt.Instoffset))); t != 0 {
+       if immrot(uint32(ctxt.Instoffset)) != 0 {
                return C_RACON
        }
-       if t := int(immrot(uint32(-ctxt.Instoffset))); t != 0 {
+       if immrot(uint32(-ctxt.Instoffset)) != 0 {
                return C_RACON
        }
        return C_LACON