}
fallthrough
- // fall through
-
case obj.TYPE_CONST:
if a.Sym != nil {
ctxt.Diag("TYPE_CONST with symbol: %v", obj.Dconv(p, a))
if ctxt.Arch.Family == sys.I386 {
v = int64(int32(v))
}
- if v == 0 {
+ switch {
+ case v == 0:
return Yi0
- }
- if v == 1 {
+ case v == 1:
return Yi1
- }
- if v >= 0 && v <= 3 {
+ case v >= 0 && v <= 3:
return Yu2
- }
- if v >= 0 && v <= 127 {
+ case v >= 0 && v <= 127:
return Yu7
- }
- if v >= 0 && v <= 255 {
+ case v >= 0 && v <= 255:
return Yu8
- }
- if v >= -128 && v <= 127 {
+ case v >= -128 && v <= 127:
return Yi8
}
if ctxt.Arch.Family == sys.I386 {
return
}
- pre := prefixof(ctxt, &p.From)
- if pre != 0 {
+ if pre := prefixof(ctxt, &p.From); pre != 0 {
ab.Put1(byte(pre))
}
- pre = prefixof(ctxt, &p.To)
- if pre != 0 {
+ if pre := prefixof(ctxt, &p.To); pre != 0 {
ab.Put1(byte(pre))
}
var rel obj.Reloc
var v int64
- args := make([]int, 0, 6)
+ args := make([]int, 0, argListMax)
if ft != Ynone*Ymax {
args = append(args, ft)
}
package x86
-type argList [6]uint8
+// argListMax specifies upper arg count limit expected to be carried by obj.Prog.
+// Max len(obj.Prog.RestArgs) can be inferred from this to be 4.
+const argListMax int = 6
+
+type argList [argListMax]uint8
type ytab struct {
zcase uint8