]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/5g, etc: prepare to unexport gc.Mp*
authorJosh Bleecher Snyder <josharian@gmail.com>
Thu, 23 Apr 2015 03:08:03 +0000 (20:08 -0700)
committerRuss Cox <rsc@golang.org>
Fri, 15 May 2015 14:16:40 +0000 (14:16 +0000)
Remove all uses of Mp* outside of the gc package.

A subsequent, automated commit in the Go 1.6
cycle will unexport all Mp* functions and types.

No functional changes. Passes toolstash -cmp.

Change-Id: Ie1604cb5b84ffb30b47f4777d4235570f2c62709
Reviewed-on: https://go-review.googlesource.com/9263
Reviewed-by: Russ Cox <rsc@golang.org>
13 files changed:
src/cmd/5g/cgen64.go
src/cmd/5g/ggen.go
src/cmd/5g/gsubr.go
src/cmd/6g/ggen.go
src/cmd/6g/gsubr.go
src/cmd/7g/ggen.go
src/cmd/7g/gsubr.go
src/cmd/8g/cgen64.go
src/cmd/8g/ggen.go
src/cmd/8g/gsubr.go
src/cmd/9g/ggen.go
src/cmd/9g/gsubr.go
src/cmd/internal/gc/const.go

index 699e555f713e005445fde099b6e3180f3c78cb5c..c55e000adcbfd835cb10d6786b64ca1b3b88c305 100644 (file)
@@ -237,7 +237,7 @@ func cgen64(n *gc.Node, res *gc.Node) {
        //      shld hi:lo, c
        //      shld lo:t, c
        case gc.OLROT:
-               v := uint64(gc.Mpgetfix(r.Val.U.Xval))
+               v := uint64(r.Int())
 
                var bl gc.Node
                gc.Regalloc(&bl, lo1.Type, nil)
@@ -291,7 +291,7 @@ func cgen64(n *gc.Node, res *gc.Node) {
                var p4 *obj.Prog
                var p5 *obj.Prog
                if r.Op == gc.OLITERAL {
-                       v := uint64(gc.Mpgetfix(r.Val.U.Xval))
+                       v := uint64(r.Int())
                        if v >= 64 {
                                // TODO(kaib): replace with gins(AMOVW, nodintconst(0), &al)
                                // here and below (verify it optimizes to EOR)
@@ -452,7 +452,7 @@ func cgen64(n *gc.Node, res *gc.Node) {
                var creg gc.Node
                var p3 *obj.Prog
                if r.Op == gc.OLITERAL {
-                       v := uint64(gc.Mpgetfix(r.Val.U.Xval))
+                       v := uint64(r.Int())
                        if v >= 64 {
                                if bh.Type.Etype == gc.TINT32 {
                                        //      MOVW    bh->31, al
index c2bd6dda0a2d77631bd0e14bdabcf2afa10d3381..e4612362a2a789e19a51160c5abe01acb2714550 100644 (file)
@@ -183,7 +183,7 @@ func cgen_shift(op int, bounded bool, nl *gc.Node, nr *gc.Node, res *gc.Node) {
        w := int(nl.Type.Width * 8)
 
        if op == gc.OLROT {
-               v := int(gc.Mpgetfix(nr.Val.U.Xval))
+               v := nr.Int()
                var n1 gc.Node
                gc.Regalloc(&n1, nl.Type, res)
                if w == 32 {
@@ -210,7 +210,7 @@ func cgen_shift(op int, bounded bool, nl *gc.Node, nr *gc.Node, res *gc.Node) {
                var n1 gc.Node
                gc.Regalloc(&n1, nl.Type, res)
                gc.Cgen(nl, &n1)
-               sc := uint64(gc.Mpgetfix(nr.Val.U.Xval))
+               sc := uint64(nr.Int())
                if sc == 0 {
                } else // nothing to do
                if sc >= uint64(nl.Type.Width*8) {
@@ -480,7 +480,7 @@ func ginscon(as int, c int64, n *gc.Node) {
 }
 
 func ginscmp(op int, t *gc.Type, n1, n2 *gc.Node, likely int) *obj.Prog {
-       if gc.Isint[t.Etype] && n1.Op == gc.OLITERAL && gc.Mpgetfix(n1.Val.U.Xval) == 0 && n2.Op != gc.OLITERAL {
+       if gc.Isint[t.Etype] && n1.Op == gc.OLITERAL && n1.Int() == 0 && n2.Op != gc.OLITERAL {
                op = gc.Brrev(op)
                n1, n2 = n2, n1
        }
@@ -489,7 +489,7 @@ func ginscmp(op int, t *gc.Type, n1, n2 *gc.Node, likely int) *obj.Prog {
        gc.Regalloc(&g1, n1.Type, &r1)
        gc.Cgen(n1, &g1)
        gmove(&g1, &r1)
-       if gc.Isint[t.Etype] && n2.Op == gc.OLITERAL && gc.Mpgetfix(n2.Val.U.Xval) == 0 {
+       if gc.Isint[t.Etype] && n2.Op == gc.OLITERAL && n2.Int() == 0 {
                gins(arm.ACMP, &r1, n2)
        } else {
                gc.Regalloc(&r2, t, n2)
index 57d511e6f64cdba073e9853e4df0a8160e406d5f..db46d6e9ee5e3b84697a930d88eac086490f66ac 100644 (file)
@@ -53,7 +53,7 @@ func ncon(i uint32) *gc.Node {
        if ncon_n.Type == nil {
                gc.Nodconst(&ncon_n, gc.Types[gc.TUINT32], 0)
        }
-       gc.Mpmovecfix(ncon_n.Val.U.Xval, int64(i))
+       ncon_n.SetInt(int64(i))
        return &ncon_n
 }
 
@@ -112,7 +112,7 @@ func split64(n *gc.Node, lo *gc.Node, hi *gc.Node) {
        case gc.OLITERAL:
                var n1 gc.Node
                gc.Convconst(&n1, n.Type, &n.Val)
-               i := gc.Mpgetfix(n1.Val.U.Xval)
+               i := n1.Int()
                gc.Nodconst(lo, gc.Types[gc.TUINT32], int64(uint32(i)))
                i >>= 32
                if n.Type.Etype == gc.TINT64 {
@@ -1118,7 +1118,7 @@ func sudoaddable(as int, n *gc.Node, a *obj.Addr) bool {
                if !gc.Isconst(n, gc.CTINT) {
                        break
                }
-               v := gc.Mpgetfix(n.Val.U.Xval)
+               v := n.Int()
                if v >= 32000 || v <= -32000 {
                        break
                }
index 6e5e6bc4cac4a48acbfe38bedd34e6ce8264ba78..12198d7187353784728348d23dba76b325ba6789 100644 (file)
@@ -190,9 +190,9 @@ func dodiv(op int, nl *gc.Node, nr *gc.Node, res *gc.Node) {
        check := 0
        if gc.Issigned[t.Etype] {
                check = 1
-               if gc.Isconst(nl, gc.CTINT) && gc.Mpgetfix(nl.Val.U.Xval) != -(1<<uint64(t.Width*8-1)) {
+               if gc.Isconst(nl, gc.CTINT) && nl.Int() != -(1<<uint64(t.Width*8-1)) {
                        check = 0
-               } else if gc.Isconst(nr, gc.CTINT) && gc.Mpgetfix(nr.Val.U.Xval) != -1 {
+               } else if gc.Isconst(nr, gc.CTINT) && nr.Int() != -1 {
                        check = 0
                }
        }
@@ -381,7 +381,7 @@ func cgen_shift(op int, bounded bool, nl *gc.Node, nr *gc.Node, res *gc.Node) {
                var n1 gc.Node
                gc.Regalloc(&n1, nl.Type, res)
                gc.Cgen(nl, &n1)
-               sc := uint64(gc.Mpgetfix(nr.Val.U.Xval))
+               sc := uint64(nr.Int())
                if sc >= uint64(nl.Type.Width*8) {
                        // large shift gets 2 shifts by width-1
                        var n3 gc.Node
index 14e1a57cbd12d965dcaea209a2699e350f6d2e25..4e54bc8de5e4470aded889e8e60449495d8203d2 100644 (file)
@@ -32,6 +32,7 @@ package main
 
 import (
        "cmd/internal/gc"
+       "cmd/internal/gc/big"
        "cmd/internal/obj"
        "cmd/internal/obj/x86"
        "fmt"
@@ -139,29 +140,27 @@ func ginsboolval(a int, n *gc.Node) {
        gins(jmptoset(a), nil, n)
 }
 
-/*
- * set up nodes representing 2^63
- */
-var bigi gc.Node
-
-var bigf gc.Node
-
-var bignodes_did int
+// set up nodes representing 2^63
+var (
+       bigi         gc.Node
+       bigf         gc.Node
+       bignodes_did bool
+)
 
 func bignodes() {
-       if bignodes_did != 0 {
+       if bignodes_did {
                return
        }
-       bignodes_did = 1
+       bignodes_did = true
+
+       var i big.Int
+       i.SetInt64(1)
+       i.Lsh(&i, 63)
 
-       gc.Nodconst(&bigi, gc.Types[gc.TUINT64], 1)
-       gc.Mpshiftfix(bigi.Val.U.Xval, 63)
+       gc.Nodconst(&bigi, gc.Types[gc.TUINT64], 0)
+       bigi.SetBigInt(&i)
 
-       bigf = bigi
-       bigf.Type = gc.Types[gc.TFLOAT64]
-       bigf.Val.Ctype = gc.CTFLT
-       bigf.Val.U.Fval = new(gc.Mpflt)
-       gc.Mpmovefixflt(bigf.Val.U.Fval, bigi.Val.U.Xval)
+       gc.Convconst(&bigf, gc.Types[gc.TFLOAT64], &bigi.Val)
 }
 
 /*
@@ -206,10 +205,7 @@ func gmove(f *gc.Node, t *gc.Node) {
                        // 64-bit immediates are really 32-bit sign-extended
                        // unless moving into a register.
                        if gc.Isint[tt] {
-                               if gc.Mpcmpfixfix(con.Val.U.Xval, gc.Minintval[gc.TINT32]) < 0 {
-                                       goto hard
-                               }
-                               if gc.Mpcmpfixfix(con.Val.U.Xval, gc.Maxintval[gc.TINT32]) > 0 {
+                               if i := con.Int(); int64(int32(i)) != i {
                                        goto hard
                                }
                        }
@@ -1273,7 +1269,7 @@ func sudoaddable(as int, n *gc.Node, a *obj.Addr) bool {
                if !gc.Isconst(n, gc.CTINT) {
                        break
                }
-               v := gc.Mpgetfix(n.Val.U.Xval)
+               v := n.Int()
                if v >= 32000 || v <= -32000 {
                        break
                }
index b824a3a18c7b677a66148d34d167fdc31fd4994b..af51c31648651249059bf4d86cfb4b0491f687aa 100644 (file)
@@ -147,9 +147,9 @@ func dodiv(op int, nl *gc.Node, nr *gc.Node, res *gc.Node) {
        check := 0
        if gc.Issigned[t.Etype] {
                check = 1
-               if gc.Isconst(nl, gc.CTINT) && gc.Mpgetfix(nl.Val.U.Xval) != -(1<<uint64(t.Width*8-1)) {
+               if gc.Isconst(nl, gc.CTINT) && nl.Int() != -(1<<uint64(t.Width*8-1)) {
                        check = 0
-               } else if gc.Isconst(nr, gc.CTINT) && gc.Mpgetfix(nr.Val.U.Xval) != -1 {
+               } else if gc.Isconst(nr, gc.CTINT) && nr.Int() != -1 {
                        check = 0
                }
        }
@@ -312,7 +312,7 @@ func cgen_shift(op int, bounded bool, nl *gc.Node, nr *gc.Node, res *gc.Node) {
                var n1 gc.Node
                gc.Regalloc(&n1, nl.Type, res)
                gc.Cgen(nl, &n1)
-               sc := uint64(uint64(gc.Mpgetfix(nr.Val.U.Xval)))
+               sc := uint64(nr.Int())
                if sc >= uint64(nl.Type.Width*8) {
                        // large shift gets 2 shifts by width-1
                        var n3 gc.Node
index 60c3a7ad44d95dd8817381c8e08a2804b035ce1b..2f03b121b45b2af9bc740dec89541c7345a9f28a 100644 (file)
@@ -115,7 +115,7 @@ func ginscmp(op int, t *gc.Type, n1, n2 *gc.Node, likely int) *obj.Prog {
        gc.Cgen(n1, &g1)
        gmove(&g1, &r1)
        if gc.Isint[t.Etype] && gc.Isconst(n2, gc.CTINT) {
-               ginscon2(optoas(gc.OCMP, t), &r1, gc.Mpgetfix(n2.Val.U.Xval))
+               ginscon2(optoas(gc.OCMP, t), &r1, n2.Int())
        } else {
                gc.Regalloc(&r2, t, n2)
                gc.Regalloc(&g2, n1.Type, &r2)
@@ -473,7 +473,7 @@ func intLiteral(n *gc.Node) (x int64, ok bool) {
        }
        switch n.Val.Ctype {
        case gc.CTINT, gc.CTRUNE:
-               return gc.Mpgetfix(n.Val.U.Xval), true
+               return n.Int(), true
        case gc.CTBOOL:
                return int64(obj.Bool2int(n.Val.U.Bval)), true
        }
index a682e2fb444b1e7f1572034c62e2ed3ab9e6ffe3..80a9642f75ca9e6f4a92a44cf5601d6ee00d3185 100644 (file)
@@ -162,7 +162,7 @@ func cgen64(n *gc.Node, res *gc.Node) {
        //      shld hi:lo, c
        //      shld lo:t, c
        case gc.OLROT:
-               v := uint64(gc.Mpgetfix(r.Val.U.Xval))
+               v := uint64(r.Int())
 
                if v >= 32 {
                        // reverse during load to do the first 32 bits of rotate
@@ -189,7 +189,7 @@ func cgen64(n *gc.Node, res *gc.Node) {
 
        case gc.OLSH:
                if r.Op == gc.OLITERAL {
-                       v := uint64(gc.Mpgetfix(r.Val.U.Xval))
+                       v := uint64(r.Int())
                        if v >= 64 {
                                if gc.Is64(r.Type) {
                                        splitclean()
@@ -278,7 +278,7 @@ func cgen64(n *gc.Node, res *gc.Node) {
 
        case gc.ORSH:
                if r.Op == gc.OLITERAL {
-                       v := uint64(gc.Mpgetfix(r.Val.U.Xval))
+                       v := uint64(r.Int())
                        if v >= 64 {
                                if gc.Is64(r.Type) {
                                        splitclean()
@@ -400,9 +400,8 @@ func cgen64(n *gc.Node, res *gc.Node) {
 
                if lo2.Op == gc.OLITERAL {
                        // special cases for constants.
-                       lv := uint32(gc.Mpgetfix(lo2.Val.U.Xval))
-
-                       hv := uint32(gc.Mpgetfix(hi2.Val.U.Xval))
+                       lv := uint32(lo2.Int())
+                       hv := uint32(hi2.Int())
                        splitclean() // right side
                        split64(res, &lo2, &hi2)
                        switch n.Op {
index 59025525faa7130af3ee878b0f5b4ca086a85ae2..baa1b64d1efc06d11d4ac924585c190c4c0f5780 100644 (file)
@@ -216,9 +216,9 @@ func dodiv(op int, nl *gc.Node, nr *gc.Node, res *gc.Node, ax *gc.Node, dx *gc.N
        check := 0
        if gc.Issigned[t.Etype] {
                check = 1
-               if gc.Isconst(nl, gc.CTINT) && gc.Mpgetfix(nl.Val.U.Xval) != -1<<uint64(t.Width*8-1) {
+               if gc.Isconst(nl, gc.CTINT) && nl.Int() != -1<<uint64(t.Width*8-1) {
                        check = 0
-               } else if gc.Isconst(nr, gc.CTINT) && gc.Mpgetfix(nr.Val.U.Xval) != -1 {
+               } else if gc.Isconst(nr, gc.CTINT) && nr.Int() != -1 {
                        check = 0
                }
        }
@@ -391,7 +391,7 @@ func cgen_shift(op int, bounded bool, nl *gc.Node, nr *gc.Node, res *gc.Node) {
                var n1 gc.Node
                gc.Regalloc(&n1, nl.Type, res)
                gmove(&n2, &n1)
-               sc := uint64(gc.Mpgetfix(nr.Val.U.Xval))
+               sc := uint64(nr.Int())
                if sc >= uint64(nl.Type.Width*8) {
                        // large shift gets 2 shifts by width-1
                        gins(a, ncon(uint32(w)-1), &n1)
index d1134d2c7471440e060a3a894c387ada1f4f067f..6878883b2895ba46d2921f2744f1e7af66b1eb72 100644 (file)
@@ -32,6 +32,7 @@ package main
 
 import (
        "cmd/internal/gc"
+       "cmd/internal/gc/big"
        "cmd/internal/obj"
        "cmd/internal/obj/x86"
        "fmt"
@@ -641,7 +642,7 @@ func ncon(i uint32) *gc.Node {
        if ncon_n.Type == nil {
                gc.Nodconst(&ncon_n, gc.Types[gc.TUINT32], 0)
        }
-       gc.Mpmovecfix(ncon_n.Val.U.Xval, int64(i))
+       ncon_n.SetInt(int64(i))
        return &ncon_n
 }
 
@@ -700,7 +701,7 @@ func split64(n *gc.Node, lo *gc.Node, hi *gc.Node) {
        case gc.OLITERAL:
                var n1 gc.Node
                gc.Convconst(&n1, n.Type, &n.Val)
-               i := gc.Mpgetfix(n1.Val.U.Xval)
+               i := n1.Int()
                gc.Nodconst(lo, gc.Types[gc.TUINT32], int64(uint32(i)))
                i >>= 32
                if n.Type.Etype == gc.TINT64 {
@@ -721,36 +722,36 @@ func splitclean() {
        }
 }
 
-/*
- * set up nodes representing fp constants
- */
-var zerof gc.Node
-
-var two64f gc.Node
-
-var two63f gc.Node
-
-var bignodes_did int
+// set up nodes representing fp constants
+var (
+       zerof        gc.Node
+       two63f       gc.Node
+       two64f       gc.Node
+       bignodes_did bool
+)
 
 func bignodes() {
-       if bignodes_did != 0 {
+       if bignodes_did {
                return
        }
-       bignodes_did = 1
+       bignodes_did = true
+
+       gc.Nodconst(&zerof, gc.Types[gc.TINT64], 0)
+       gc.Convconst(&zerof, gc.Types[gc.TFLOAT64], &zerof.Val)
 
-       two64f = *ncon(0)
-       two64f.Type = gc.Types[gc.TFLOAT64]
-       two64f.Val.Ctype = gc.CTFLT
-       two64f.Val.U.Fval = new(gc.Mpflt)
-       gc.Mpmovecflt(two64f.Val.U.Fval, 18446744073709551616.)
+       var i big.Int
+       i.SetInt64(1)
+       i.Lsh(&i, 63)
+       var bigi gc.Node
 
-       two63f = two64f
-       two63f.Val.U.Fval = new(gc.Mpflt)
-       gc.Mpmovecflt(two63f.Val.U.Fval, 9223372036854775808.)
+       gc.Nodconst(&bigi, gc.Types[gc.TUINT64], 0)
+       bigi.SetBigInt(&i)
+       gc.Convconst(&two63f, gc.Types[gc.TFLOAT64], &bigi.Val)
 
-       zerof = two64f
-       zerof.Val.U.Fval = new(gc.Mpflt)
-       gc.Mpmovecflt(zerof.Val.U.Fval, 0)
+       gc.Nodconst(&bigi, gc.Types[gc.TUINT64], 0)
+       i.Lsh(&i, 1)
+       bigi.SetBigInt(&i)
+       gc.Convconst(&two64f, gc.Types[gc.TFLOAT64], &bigi.Val)
 }
 
 func memname(n *gc.Node, t *gc.Type) {
index 28ebd9cc01b246328c89aa3d9a394ee107765831..265536921ad2e463b2f0250dc22e26383dbc07ba 100644 (file)
@@ -141,9 +141,9 @@ func dodiv(op int, nl *gc.Node, nr *gc.Node, res *gc.Node) {
        check := 0
        if gc.Issigned[t.Etype] {
                check = 1
-               if gc.Isconst(nl, gc.CTINT) && gc.Mpgetfix(nl.Val.U.Xval) != -(1<<uint64(t.Width*8-1)) {
+               if gc.Isconst(nl, gc.CTINT) && nl.Int() != -(1<<uint64(t.Width*8-1)) {
                        check = 0
-               } else if gc.Isconst(nr, gc.CTINT) && gc.Mpgetfix(nr.Val.U.Xval) != -1 {
+               } else if gc.Isconst(nr, gc.CTINT) && nr.Int() != -1 {
                        check = 0
                }
        }
@@ -308,7 +308,7 @@ func cgen_shift(op int, bounded bool, nl *gc.Node, nr *gc.Node, res *gc.Node) {
                var n1 gc.Node
                gc.Regalloc(&n1, nl.Type, res)
                gc.Cgen(nl, &n1)
-               sc := uint64(uint64(gc.Mpgetfix(nr.Val.U.Xval)))
+               sc := uint64(nr.Int())
                if sc >= uint64(nl.Type.Width*8) {
                        // large shift gets 2 shifts by width-1
                        var n3 gc.Node
index 61ba87ee3e666f72fb2f66edc4500516128858c8..f14f93734c42e689579fe4b21d7bffd45380dea9 100644 (file)
@@ -32,6 +32,7 @@ package main
 
 import (
        "cmd/internal/gc"
+       "cmd/internal/gc/big"
        "cmd/internal/obj"
        "cmd/internal/obj/ppc64"
        "fmt"
@@ -129,7 +130,7 @@ func ginscmp(op int, t *gc.Type, n1, n2 *gc.Node, likely int) *obj.Prog {
        gc.Cgen(n1, &g1)
        gmove(&g1, &r1)
        if gc.Isint[t.Etype] && gc.Isconst(n2, gc.CTINT) {
-               ginscon2(optoas(gc.OCMP, t), &r1, gc.Mpgetfix(n2.Val.U.Xval))
+               ginscon2(optoas(gc.OCMP, t), &r1, n2.Int())
        } else {
                gc.Regalloc(&r2, t, n2)
                gc.Regalloc(&g2, n1.Type, &r2)
@@ -144,29 +145,27 @@ func ginscmp(op int, t *gc.Type, n1, n2 *gc.Node, likely int) *obj.Prog {
        return gc.Gbranch(optoas(op, t), nil, likely)
 }
 
-/*
- * set up nodes representing 2^63
- */
-var bigi gc.Node
-
-var bigf gc.Node
-
-var bignodes_did int
+// set up nodes representing 2^63
+var (
+       bigi         gc.Node
+       bigf         gc.Node
+       bignodes_did bool
+)
 
 func bignodes() {
-       if bignodes_did != 0 {
+       if bignodes_did {
                return
        }
-       bignodes_did = 1
+       bignodes_did = true
+
+       var i big.Int
+       i.SetInt64(1)
+       i.Lsh(&i, 63)
 
-       gc.Nodconst(&bigi, gc.Types[gc.TUINT64], 1)
-       gc.Mpshiftfix(bigi.Val.U.Xval, 63)
+       gc.Nodconst(&bigi, gc.Types[gc.TUINT64], 0)
+       bigi.SetBigInt(&i)
 
-       bigf = bigi
-       bigf.Type = gc.Types[gc.TFLOAT64]
-       bigf.Val.Ctype = gc.CTFLT
-       bigf.Val.U.Fval = new(gc.Mpflt)
-       gc.Mpmovefixflt(bigf.Val.U.Fval, bigi.Val.U.Xval)
+       gc.Convconst(&bigf, gc.Types[gc.TFLOAT64], &bigi.Val)
 }
 
 /*
@@ -552,7 +551,7 @@ func intLiteral(n *gc.Node) (x int64, ok bool) {
        }
        switch n.Val.Ctype {
        case gc.CTINT, gc.CTRUNE:
-               return gc.Mpgetfix(n.Val.U.Xval), true
+               return n.Int(), true
        case gc.CTBOOL:
                return int64(obj.Bool2int(n.Val.U.Bval)), true
        }
index 84b133769c6f49206db22cbee75f51efc2c7c068..748752679bc271af41bd0106e286644246fa9790 100644 (file)
@@ -5,10 +5,38 @@
 package gc
 
 import (
+       "cmd/internal/gc/big"
        "cmd/internal/obj"
        "strings"
 )
 
+// Int returns n as an int.
+// n must be an integer constant.
+func (n *Node) Int() int64 {
+       if !Isconst(n, CTINT) {
+               Fatal("Int(%v)", n)
+       }
+       return Mpgetfix(n.Val.U.Xval)
+}
+
+// SetInt sets n's value to i.
+// n must be an integer constant.
+func (n *Node) SetInt(i int64) {
+       if !Isconst(n, CTINT) {
+               Fatal("SetInt(%v)", n)
+       }
+       Mpmovecfix(n.Val.U.Xval, i)
+}
+
+// SetBigInt sets n's value to x.
+// n must be an integer constant.
+func (n *Node) SetBigInt(x *big.Int) {
+       if !Isconst(n, CTINT) {
+               Fatal("SetBigInt(%v)", n)
+       }
+       n.Val.U.Xval.Val.Set(x)
+}
+
 /*
  * truncate float literal fv to 32-bit or 64-bit precision
  * according to type; return truncated value.