for _, a := range hash[h] {
cmp.Op = OEQ
cmp.Left = n
- b := uint32(0)
+ b := false
if a.Op == OCONVIFACE && orign.Op == OCONVIFACE {
if Eqtype(a.Left.Type, n.Type) {
cmp.Right = a.Left
evconst(&cmp)
if cmp.Op == OLITERAL {
// Sometimes evconst fails. See issue 12536.
- b = uint32(obj.Bool2int(cmp.Val().U.(bool)))
+ b = cmp.Val().U.(bool)
}
}
} else if Eqtype(a.Type, n.Type) {
cmp.Right = a
evconst(&cmp)
if cmp.Op == OLITERAL {
- b = uint32(obj.Bool2int(cmp.Val().U.(bool)))
+ b = cmp.Val().U.(bool)
}
}
- if b != 0 {
+ if b {
Yyerror("duplicate key %v in map literal", n)
return
}
* drop the pool now, and branch round it.
*/
func checkpool(ctxt *obj.Link, p *obj.Prog, skip int) {
- if pool.size >= 0xffff0 || !(ispcdisp(int32(p.Pc+4+int64(pool.size)-int64(pool.start)+8)) != 0) {
+ if pool.size >= 0xffff0 || !ispcdisp(int32(p.Pc+4+int64(pool.size)-int64(pool.start)+8)) {
flushpool(ctxt, p, skip)
} else if p.Link == nil {
flushpool(ctxt, p, 2)
return uint32(ctxt.Instoffset)
}
-func ispcdisp(v int32) int {
+func ispcdisp(v int32) bool {
/* pc-relative addressing will reach? */
- return obj.Bool2int(v >= -0xfffff && v <= 0xfffff && (v&3) == 0)
+ return v >= -0xfffff && v <= 0xfffff && (v&3) == 0
}
-func isaddcon(v int64) int {
+func isaddcon(v int64) bool {
/* uimm12 or uimm24? */
if v < 0 {
- return 0
+ return false
}
if (v & 0xFFF) == 0 {
v >>= 12
}
- return obj.Bool2int(v <= 0xFFF)
+ return v <= 0xFFF
}
-func isbitcon(v uint64) int {
+func isbitcon(v uint64) bool {
/* fancy bimm32 or bimm64? */
// TODO(aram):
- return 0
- // return obj.Bool2int(findmask(v) != nil || (v>>32) == 0 && findmask(v|(v<<32)) != nil)
+ return false
+ // return findmask(v) != nil || (v>>32) == 0 && findmask(v|(v<<32)) != nil
}
func autoclass(l int64) int {
if v == 0 {
return C_ZCON
}
- if isaddcon(v) != 0 {
+ if isaddcon(v) {
if v <= 0xFFF {
return C_ADDCON0
}
- if isbitcon(uint64(v)) != 0 {
+ if isbitcon(uint64(v)) {
return C_ABCON
}
return C_ADDCON
t := movcon(v)
if t >= 0 {
- if isbitcon(uint64(v)) != 0 {
+ if isbitcon(uint64(v)) {
return C_MBCON
}
return C_MOVCON
t = movcon(^v)
if t >= 0 {
- if isbitcon(uint64(v)) != 0 {
+ if isbitcon(uint64(v)) {
return C_MBCON
}
return C_MOVCON
}
- if isbitcon(uint64(v)) != 0 {
+ if isbitcon(uint64(v)) {
return C_BITCON
}
return C_GOK
aconsize:
- if isaddcon(ctxt.Instoffset) != 0 {
+ if isaddcon(ctxt.Instoffset) {
return C_AACON
}
return C_LACON
case 24: /* mov/mvn Rs,Rd -> add $0,Rs,Rd or orr Rs,ZR,Rd */
rf := int(p.From.Reg)
rt := int(p.To.Reg)
- s := obj.Bool2int(rf == REGSP || rt == REGSP)
+ s := rf == REGSP || rt == REGSP
if p.As == AMVN || p.As == AMVNW {
- if s != 0 {
+ if s {
ctxt.Diag("illegal SP reference\n%v", p)
}
o1 = oprrr(ctxt, int(p.As))
o1 |= (uint32(rf&31) << 16) | (REGZERO & 31 << 5) | uint32(rt&31)
- } else if s != 0 {
+ } else if s {
o1 = opirr(ctxt, int(p.As))
o1 |= (uint32(rf&31) << 5) | uint32(rt&31)
} else {