]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: give mparith{2,3}.go files more meaningful names
authorMatthew Dempsky <mdempsky@google.com>
Tue, 1 Mar 2016 04:20:13 +0000 (20:20 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 1 Mar 2016 05:03:58 +0000 (05:03 +0000)
Also, relocate related const and type definitions from go.go.

Change-Id: Ieb9b672da8dd510ca67022b4f7ae49a778a56579
Reviewed-on: https://go-review.googlesource.com/20080
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/go.go
src/cmd/compile/internal/gc/mpfloat.go [moved from src/cmd/compile/internal/gc/mparith3.go with 92% similarity]
src/cmd/compile/internal/gc/mpint.go [moved from src/cmd/compile/internal/gc/mparith2.go with 96% similarity]

index df460f8ddcec715127482b03c7769033ab8d873d..ce3ad003c010aa4f345c25b7dd7e057ffe986270 100644 (file)
@@ -6,7 +6,6 @@ package gc
 
 import (
        "bytes"
-       "cmd/compile/internal/big"
        "cmd/internal/obj"
 )
 
@@ -17,32 +16,6 @@ const (
        MaxStackVarSize = 10 * 1024 * 1024
 )
 
-const (
-       // Maximum size in bits for Mpints before signalling
-       // overflow and also mantissa precision for Mpflts.
-       Mpprec = 512
-       // Turn on for constant arithmetic debugging output.
-       Mpdebug = false
-)
-
-// Mpint represents an integer constant.
-type Mpint struct {
-       Val  big.Int
-       Ovf  bool // set if Val overflowed compiler limit (sticky)
-       Rune bool // set if syntax indicates default type rune
-}
-
-// Mpflt represents a floating-point constant.
-type Mpflt struct {
-       Val big.Float
-}
-
-// Mpcplx represents a complex constant.
-type Mpcplx struct {
-       Real Mpflt
-       Imag Mpflt
-}
-
 type Val struct {
        // U contains one of:
        // bool     bool when n.ValCtype() == CTBOOL
similarity index 92%
rename from src/cmd/compile/internal/gc/mparith3.go
rename to src/cmd/compile/internal/gc/mpfloat.go
index 5b61a9e17fd32aa3f1840a316d7c4c9b93da8b81..48aa1efc6dc8c416bbde7080bf59924cc49f6e8d 100644 (file)
@@ -13,6 +13,25 @@ import (
 
 // implements float arithmetic
 
+const (
+       // Maximum size in bits for Mpints before signalling
+       // overflow and also mantissa precision for Mpflts.
+       Mpprec = 512
+       // Turn on for constant arithmetic debugging output.
+       Mpdebug = false
+)
+
+// Mpflt represents a floating-point constant.
+type Mpflt struct {
+       Val big.Float
+}
+
+// Mpcplx represents a complex constant.
+type Mpcplx struct {
+       Real Mpflt
+       Imag Mpflt
+}
+
 func newMpflt() *Mpflt {
        var a Mpflt
        a.Val.SetPrec(Mpprec)
similarity index 96%
rename from src/cmd/compile/internal/gc/mparith2.go
rename to src/cmd/compile/internal/gc/mpint.go
index 67faf294796f2e48294033d8d1f94eb173f6d9f7..c2f1884b85834555f9fd937844bcf14a922bb055 100644 (file)
@@ -10,7 +10,14 @@ import (
        "fmt"
 )
 
-/// implements fix arithmetic
+// implements integer arithmetic
+
+// Mpint represents an integer constant.
+type Mpint struct {
+       Val  big.Int
+       Ovf  bool // set if Val overflowed compiler limit (sticky)
+       Rune bool // set if syntax indicates default type rune
+}
 
 func mpsetovf(a *Mpint) {
        a.Val.SetUint64(1) // avoid spurious div-zero errors