aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj
diff options
context:
space:
mode:
authorKunpei Sakai <namusyaka@gmail.com>2018-02-25 20:08:22 +0900
committerMatthew Dempsky <mdempsky@google.com>2018-02-26 20:22:06 +0000
commit0c471dfae29b0759c6f12e32d2d5ca69ea79d5d8 (patch)
treea1f155bc179ab634ddbfc5639b37275aa7b36f58 /src/cmd/internal/obj
parentf4d9c309018f6bbb85c7076a9fbe0387fb7b0b1c (diff)
downloadgo-0c471dfae29b0759c6f12e32d2d5ca69ea79d5d8.tar.xz
cmd: avoid unnecessary type conversions
CL generated mechanically with github.com/mdempsky/unconvert. Also updated cmd/compile/internal/ssa/gen/*.rules manually. Change-Id: If721ef73cf0771ae83ce7e2d11623fc8d9155768 Reviewed-on: https://go-review.googlesource.com/97075 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/internal/obj')
-rw-r--r--src/cmd/internal/obj/arm/obj5.go2
-rw-r--r--src/cmd/internal/obj/arm64/asm7.go14
-rw-r--r--src/cmd/internal/obj/ppc64/obj9.go2
-rw-r--r--src/cmd/internal/obj/x86/asm6.go2
4 files changed, 10 insertions, 10 deletions
diff --git a/src/cmd/internal/obj/arm/obj5.go b/src/cmd/internal/obj/arm/obj5.go
index f7d0f17168..2046649e38 100644
--- a/src/cmd/internal/obj/arm/obj5.go
+++ b/src/cmd/internal/obj/arm/obj5.go
@@ -346,7 +346,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
o := p.As
switch o {
case obj.ATEXT:
- autosize = int32(autoffset)
+ autosize = autoffset
if p.Mark&LEAF != 0 && autosize == 0 {
// A leaf function with no locals has no frame.
diff --git a/src/cmd/internal/obj/arm64/asm7.go b/src/cmd/internal/obj/arm64/asm7.go
index 9d064806a1..a8b2e1d39e 100644
--- a/src/cmd/internal/obj/arm64/asm7.go
+++ b/src/cmd/internal/obj/arm64/asm7.go
@@ -861,7 +861,7 @@ func (c *ctxt7) addpool(p *obj.Prog, a *obj.Addr) {
// MOVD addr, REGTMP
// MOVD REGTMP, R
// where addr is the address of the DWORD containing the address of foo.
- if p.As == AMOVD && a.Type != obj.TYPE_MEM || cls == C_ADDR || cls == C_VCON || int64(lit) != int64(int32(lit)) || uint64(lit) != uint64(uint32(lit)) {
+ if p.As == AMOVD && a.Type != obj.TYPE_MEM || cls == C_ADDR || cls == C_VCON || lit != int64(int32(lit)) || uint64(lit) != uint64(uint32(lit)) {
// conservative: don't know if we want signed or unsigned extension.
// in case of ambiguity, store 64-bit
t.As = ADWORD
@@ -2838,7 +2838,7 @@ func (c *ctxt7) asmout(p *obj.Prog, o *Optab, out []uint32) {
if v == 0 {
c.ctxt.Diag("illegal system register:\n%v", p)
}
- if (o1 & uint32(v&^(3<<19))) != 0 {
+ if (o1 & (v &^ (3 << 19))) != 0 {
c.ctxt.Diag("MRS register value overlap\n%v", p)
}
@@ -2858,7 +2858,7 @@ func (c *ctxt7) asmout(p *obj.Prog, o *Optab, out []uint32) {
if v == 0 {
c.ctxt.Diag("illegal system register:\n%v", p)
}
- if (o1 & uint32(v&^(3<<19))) != 0 {
+ if (o1 & (v &^ (3 << 19))) != 0 {
c.ctxt.Diag("MSR register value overlap\n%v", p)
}
@@ -3360,7 +3360,7 @@ func (c *ctxt7) asmout(p *obj.Prog, o *Optab, out []uint32) {
size = 2
} else if p.As == AVAND || p.As == AVEOR {
size = 0
- } else if (p.As == AVFMLA || p.As == AVFMLS) {
+ } else if p.As == AVFMLA || p.As == AVFMLS {
if af == ARNG_2D {
size = 1
} else {
@@ -3512,7 +3512,7 @@ func (c *ctxt7) asmout(p *obj.Prog, o *Optab, out []uint32) {
rt := int(p.To.Reg)
imm5 := 0
o1 = 1<<30 | 7<<25 | 7<<10
- index :=int(p.From.Index)
+ index := int(p.From.Index)
switch (p.To.Reg >> 5) & 15 {
case ARNG_B:
c.checkindex(p, index, 15)
@@ -3662,7 +3662,7 @@ func (c *ctxt7) asmout(p *obj.Prog, o *Optab, out []uint32) {
default:
c.ctxt.Diag("invalid arrangement on VMOV Rn, Vd.<T>: %v\n", p)
}
- o1 |= (uint32(Q&1) << 30) | (uint32(imm5&0x1f) << 16)
+ o1 |= (Q & 1 << 30) | (imm5 & 0x1f << 16)
o1 |= (uint32(rf&31) << 5) | uint32(rt&31)
case 83: /* vmov Vn.<T>, Vd.<T> */
@@ -3883,7 +3883,7 @@ func (c *ctxt7) asmout(p *obj.Prog, o *Optab, out []uint32) {
}
o1 = c.opldrpp(p, p.As)
- o1 |= (uint32(r&31) << 5) | (uint32((imm>>3)&0xfff) << 10) | (uint32(v & 31))
+ o1 |= (uint32(r&31) << 5) | ((imm >> 3) & 0xfff << 10) | (v & 31)
}
out[0] = o1
diff --git a/src/cmd/internal/obj/ppc64/obj9.go b/src/cmd/internal/obj/ppc64/obj9.go
index c50cd3b06c..c468ee93a4 100644
--- a/src/cmd/internal/obj/ppc64/obj9.go
+++ b/src/cmd/internal/obj/ppc64/obj9.go
@@ -524,7 +524,7 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
q.To.Type = obj.TYPE_MEM
q.To.Offset = int64(-autosize)
q.To.Reg = REGSP
- q.Spadj = int32(autosize)
+ q.Spadj = autosize
} else {
// Frame size is too large for a MOVDU instruction.
// Store link register before decrementing SP, so if a signal comes
diff --git a/src/cmd/internal/obj/x86/asm6.go b/src/cmd/internal/obj/x86/asm6.go
index b14d1d232b..7c666e8f6e 100644
--- a/src/cmd/internal/obj/x86/asm6.go
+++ b/src/cmd/internal/obj/x86/asm6.go
@@ -3930,7 +3930,7 @@ func (asmbuf *AsmBuf) doasm(ctxt *obj.Link, cursym *obj.LSym, p *obj.Prog) {
} else {
regnum &= byte(p.GetFrom3().Reg - REG_Y0)
}
- asmbuf.Put1(byte(o.op[z+2]) | regnum)
+ asmbuf.Put1(o.op[z+2] | regnum)
asmbuf.Put1(byte(p.From.Offset))
case Zvex_i_rm_v_r: