From: Matthew Dempsky Date: Thu, 29 Sep 2016 18:00:47 +0000 (-0700) Subject: cmd/internal/obj/arm: cleanup some unnecessary temps and conversions X-Git-Tag: go1.8beta1~1114 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=518cc7f3079bbd5ad141efb1e16c5a6eae52b831;p=gostls13.git cmd/internal/obj/arm: cleanup some unnecessary temps and conversions Change-Id: I573278c9aee80e62463b2542774dabeec7c3b098 Reviewed-on: https://go-review.googlesource.com/29969 Run-TryBot: Matthew Dempsky TryBot-Result: Gobot Gobot Reviewed-by: Cherry Zhang --- diff --git a/src/cmd/internal/obj/arm/asm5.go b/src/cmd/internal/obj/arm/asm5.go index c47863db47..a1213bcfb8 100644 --- a/src/cmd/internal/obj/arm/asm5.go +++ b/src/cmd/internal/obj/arm/asm5.go @@ -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