]> Cypherpunks repositories - gostls13.git/commitdiff
gc: delete float, complex
authorRuss Cox <rsc@golang.org>
Thu, 20 Jan 2011 04:08:11 +0000 (23:08 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 20 Jan 2011 04:08:11 +0000 (23:08 -0500)
rename cmplx -> complex

R=ken2
CC=golang-dev
https://golang.org/cl/4071041

20 files changed:
src/cmd/5g/cgen.c
src/cmd/5g/galign.c
src/cmd/5g/reg.c
src/cmd/6g/galign.c
src/cmd/6g/reg.c
src/cmd/8g/cgen.c
src/cmd/8g/galign.c
src/cmd/8g/reg.c
src/cmd/gc/align.c
src/cmd/gc/const.c
src/cmd/gc/cplx.c
src/cmd/gc/go.h
src/cmd/gc/lex.c
src/cmd/gc/print.c
src/cmd/gc/reflect.c
src/cmd/gc/sinit.c
src/cmd/gc/subr.c
src/cmd/gc/typecheck.c
src/cmd/gc/walk.c
src/cmd/ld/dwarf.c

index 7cfde993ebcc6d04b86e81563ce848a64c7bea88..032409baee3d6b7657843d7fcffccf55c63ecd9f 100644 (file)
@@ -169,7 +169,7 @@ cgen(Node *n, Node *res)
 
        case OREAL:
        case OIMAG:
-       case OCMPLX:
+       case OCOMPLEX:
                fatal("unexpected complex");
                break;
 
@@ -879,7 +879,6 @@ bgen(Node *n, int true, Prog *to)
 
        switch(n->op) {
        default:
-       def:
                a = ONE;
                if(!true)
                        a = OEQ;
index 9c8760aea7c541d3f6d89a7ddac96460e3ad1705..0fece9a08ff27f9871c6b794e1679ddb0c06829f 100644 (file)
@@ -17,8 +17,6 @@ Typedef       typedefs[] =
        "int",          TINT,           TINT32,
        "uint",         TUINT,          TUINT32,
        "uintptr",      TUINTPTR,       TUINT32,
-       "float",        TFLOAT,         TFLOAT32,
-       "complex",      TCOMPLEX,       TCOMPLEX64,
        0
 };
 
index d30d03b2060b37667ef0034f44814729abdeec04..3f1ec07e4eb52baceada1847229300675c4df122 100644 (file)
@@ -1066,7 +1066,6 @@ allreg(uint32 b, Rgn *r)
 
        case TFLOAT32:
        case TFLOAT64:
-       case TFLOAT:
                i = BtoF(~b);
                if(i && r->cost >= 0) {
                        r->regno = i+NREG;
index bdfc9947e8145231a7eda863a0bbe7f7aeb21722..97bfb58e8894d0ea4f3cefc38b5560b44c0b9814 100644 (file)
@@ -17,8 +17,6 @@ Typedef       typedefs[] =
        "int",          TINT,           TINT32,
        "uint",         TUINT,          TUINT32,
        "uintptr",      TUINTPTR,       TUINT64,
-       "float",        TFLOAT,         TFLOAT32,
-       "complex",      TCOMPLEX,       TCOMPLEX64,
        0
 };
 
index 464627066389a989eab10a5af6cf2592a0cf6cec..1e1d64c59e9449526990215403db2ea93f45568c 100644 (file)
@@ -748,7 +748,6 @@ addmove(Reg *r, int bn, int rn, int f)
        case TPTR64:
                p1->as = AMOVQ;
                break;
-       case TFLOAT:
        case TFLOAT32:
                p1->as = AMOVSS;
                break;
@@ -1180,7 +1179,6 @@ allreg(uint32 b, Rgn *r)
 
        case TFLOAT32:
        case TFLOAT64:
-       case TFLOAT:
                i = BtoF(~b);
                if(i && r->cost > 0) {
                        r->regno = i;
index 875d434fa79b336d108a2398efd3abfe07027336..9c326e8ef1a95e27c63c05d4dafec1b5ef9344fa 100644 (file)
@@ -174,7 +174,7 @@ cgen(Node *n, Node *res)
 
        case OREAL:
        case OIMAG:
-       case OCMPLX:
+       case OCOMPLEX:
                fatal("unexpected complex");
                return;
 
index 1c14dfe471a6bc545e3b3726edeaaf4b1cc887ce..48edfdf3cc124c1b45994285b460874230c21695 100644 (file)
@@ -17,8 +17,6 @@ Typedef       typedefs[] =
        "int",          TINT,           TINT32,
        "uint",         TUINT,          TUINT32,
        "uintptr",      TUINTPTR,       TUINT32,
-       "float",        TFLOAT,         TFLOAT32,
-       "complex",      TCOMPLEX,       TCOMPLEX64,
        0
 };
 
index e1dacf55ad96ee47e3bd26d142a619407656904d..1465d372ce2ffd1fcbd0825b2ae113be72defdb7 100644 (file)
@@ -1095,7 +1095,6 @@ allreg(uint32 b, Rgn *r)
 
        case TFLOAT32:
        case TFLOAT64:
-       case TFLOAT:
                break;
        }
        return 0;
index a3785e8718fbe59a3b3e0a5284576169463be337..ed20e7e8b4e5e4baae8f0a5f902a58134fb37c49 100644 (file)
@@ -412,11 +412,9 @@ typeinit(void)
 
        isfloat[TFLOAT32] = 1;
        isfloat[TFLOAT64] = 1;
-       isfloat[TFLOAT] = 1;
 
        iscomplex[TCOMPLEX64] = 1;
        iscomplex[TCOMPLEX128] = 1;
-       iscomplex[TCOMPLEX] = 1;
 
        isptr[TPTR32] = 1;
        isptr[TPTR64] = 1;
index 72e67a63405cd26a928845b92fd8a3022e998c14..0ee693c025b2a2831512e5adffac6bc5d99ae972 100644 (file)
@@ -980,10 +980,10 @@ defaultlit(Node **np, Type *t)
                n->type = types[TINT];
                goto num;
        case CTFLT:
-               n->type = types[TFLOAT];
+               n->type = types[TFLOAT64];
                goto num;
        case CTCPLX:
-               n->type = types[TCOMPLEX];
+               n->type = types[TCOMPLEX128];
                goto num;
        num:
                if(t != T) {
@@ -1034,13 +1034,13 @@ defaultlit2(Node **lp, Node **rp, int force)
        if(!force)
                return;
        if(isconst(l, CTCPLX) || isconst(r, CTCPLX)) {
-               convlit(lp, types[TCOMPLEX]);
-               convlit(rp, types[TCOMPLEX]);
+               convlit(lp, types[TCOMPLEX128]);
+               convlit(rp, types[TCOMPLEX128]);
                return;
        }
        if(isconst(l, CTFLT) || isconst(r, CTFLT)) {
-               convlit(lp, types[TFLOAT]);
-               convlit(rp, types[TFLOAT]);
+               convlit(lp, types[TFLOAT64]);
+               convlit(rp, types[TFLOAT64]);
                return;
        }
        convlit(lp, types[TINT]);
index e25f3cabb91b95f515d9d8132e591748029eb079..3ec9fe5a2c6b537222dd9b563333b3f28a4a1184 100644 (file)
@@ -84,7 +84,7 @@ maybe:
        case OSUB:
        case OMUL:
        case OMINUS:
-       case OCMPLX:
+       case OCOMPLEX:
        case OREAL:
        case OIMAG:
                goto yes;
@@ -120,7 +120,7 @@ complexgen(Node *n, Node *res)
 
        // pick off float/complex opcodes
        switch(n->op) {
-       case OCMPLX:
+       case OCOMPLEX:
                if(res->addable) {
                        subnode(&n1, &n2, res);
                        tempname(&tmp, n1.type);
@@ -195,7 +195,7 @@ complexgen(Node *n, Node *res)
        case OSUB:
        case OMUL:
        case OMINUS:
-       case OCMPLX:
+       case OCOMPLEX:
        case OREAL:
        case OIMAG:
                break;
index ee31a335756f3e43c1f289bdb93b6373d30578bf..b2d025b787f2c5f2d7150c88255076db68de2f71 100644 (file)
@@ -390,7 +390,7 @@ enum
        ORUNESTR,
        OSELRECV,
        OIOTA,
-       OREAL, OIMAG, OCMPLX,
+       OREAL, OIMAG, OCOMPLEX,
 
        // stmts
        OBLOCK,
@@ -440,11 +440,9 @@ enum
 
        TCOMPLEX64,             // 12
        TCOMPLEX128,
-       TCOMPLEX,
 
        TFLOAT32,               // 15
        TFLOAT64,
-       TFLOAT,
 
        TBOOL,                  // 18
 
index 0f1acd2fcdab7a61b1958eea216d974e0a903819..45b1257fad0b4df75e214cb4837c4cf3d22a96b2 100644 (file)
@@ -1531,7 +1531,7 @@ static    struct
        "cap",          LNAME,          Txxx,           OCAP,
        "close",        LNAME,          Txxx,           OCLOSE,
        "closed",       LNAME,          Txxx,           OCLOSED,
-       "cmplx",        LNAME,          Txxx,           OCMPLX,
+       "complex",      LNAME,          Txxx,           OCOMPLEX,
        "copy",         LNAME,          Txxx,           OCOPY,
        "imag",         LNAME,          Txxx,           OIMAG,
        "len",          LNAME,          Txxx,           OLEN,
index 6bb1f026befd8efba23949c3e1c3664028e65646..25c4126397d65cb06773c03e63c6d3c731d072d2 100644 (file)
@@ -365,8 +365,8 @@ exprfmt(Fmt *f, Node *n, int prec)
                fmtprint(f, ")");
                break;
 
-       case OCMPLX:
-               fmtprint(f, "cmplx(");
+       case OCOMPLEX:
+               fmtprint(f, "complex(");
                exprfmt(f, n->left, 0);
                fmtprint(f, ", ");
                exprfmt(f, n->right, 0);
index b31eb51549283da363254f66730da2487f5be86e..36c245d4782e3bd3c33dcd07bc8156a3d3a07355 100644 (file)
@@ -419,10 +419,8 @@ enum {
        KindUint32,
        KindUint64,
        KindUintptr,
-       KindFloat,
        KindFloat32,
        KindFloat64,
-       KindComplex,
        KindComplex64,
        KindComplex128,
        KindArray,
@@ -453,7 +451,6 @@ kinds[] =
        [TINT64]        = KindInt64,
        [TUINT64]       = KindUint64,
        [TUINTPTR]      = KindUintptr,
-       [TFLOAT]        = KindFloat,
        [TFLOAT32]      = KindFloat32,
        [TFLOAT64]      = KindFloat64,
        [TBOOL]         = KindBool,
@@ -466,7 +463,6 @@ kinds[] =
        [TMAP]          = KindMap,
        [TARRAY]                = KindArray,
        [TFUNC]         = KindFunc,
-       [TCOMPLEX]      = KindComplex,
        [TCOMPLEX64]    = KindComplex64,
        [TCOMPLEX128]   = KindComplex128,
 };
@@ -485,10 +481,8 @@ structnames[] =
        [TINT64]        = "*runtime.IntType",
        [TUINT64]       = "*runtime.UintType",
        [TUINTPTR]      = "*runtime.UintType",
-       [TCOMPLEX]      = "*runtime.ComplexType",
        [TCOMPLEX64]    = "*runtime.ComplexType",
        [TCOMPLEX128]   = "*runtime.ComplexType",
-       [TFLOAT]        = "*runtime.FloatType",
        [TFLOAT32]      = "*runtime.FloatType",
        [TFLOAT64]      = "*runtime.FloatType",
        [TBOOL]         = "*runtime.BoolType",
@@ -542,7 +536,6 @@ haspointers(Type *t)
        case TINT64:
        case TUINT64:
        case TUINTPTR:
-       case TFLOAT:
        case TFLOAT32:
        case TFLOAT64:
        case TBOOL:
index 19ee3327b430aa3e19f343ba2ebf096ba3a6c400..be96a1477a25d6619e35ce131b3add2e455d3f93 100644 (file)
@@ -917,14 +917,12 @@ gen_as_init(Node *n)
        case TPTR64:
        case TFLOAT32:
        case TFLOAT64:
-       case TFLOAT:
                gused(N); // in case the data is the dest of a goto
                gdata(&nam, nr, nr->type->width);
                break;
 
        case TCOMPLEX64:
        case TCOMPLEX128:
-       case TCOMPLEX:
                gused(N); // in case the data is the dest of a goto
                gdatacomplex(&nam, nr->val.u.cval);
                break;
index 3c450109629de46d5f910aed5996d09957b6b32b..cb5e2a831d9908042b2c2e7197bf1ebd2529ca8a 100644 (file)
@@ -836,7 +836,7 @@ goopnames[] =
        [OCASE]         = "case",
        [OCLOSED]       = "closed",
        [OCLOSE]        = "close",
-       [OCMPLX]        = "cmplx",
+       [OCOMPLEX]      = "complex",
        [OCOM]          = "^",
        [OCONTINUE]     = "continue",
        [OCOPY]         = "copy",
@@ -993,10 +993,8 @@ etnames[] =
        [TINT64]        = "INT64",
        [TUINT64]       = "UINT64",
        [TUINTPTR]      = "UINTPTR",
-       [TFLOAT]        = "FLOAT",
        [TFLOAT32]      = "FLOAT32",
        [TFLOAT64]      = "FLOAT64",
-       [TCOMPLEX]      = "COMPLEX",
        [TCOMPLEX64]    = "COMPLEX64",
        [TCOMPLEX128]   = "COMPLEX128",
        [TBOOL]         = "BOOL",
@@ -1117,10 +1115,8 @@ basicnames[] =
        [TINT64]        = "int64",
        [TUINT64]       = "uint64",
        [TUINTPTR]      = "uintptr",
-       [TFLOAT]        = "float",
        [TFLOAT32]      = "float32",
        [TFLOAT64]      = "float64",
-       [TCOMPLEX]      = "complex",
        [TCOMPLEX64]    = "complex64",
        [TCOMPLEX128]   = "complex128",
        [TBOOL]         = "bool",
@@ -1752,8 +1748,6 @@ int
 cplxsubtype(int et)
 {
        switch(et) {
-       case TCOMPLEX:
-               return TFLOAT;
        case TCOMPLEX64:
                return TFLOAT32;
        case TCOMPLEX128:
index ca114d47cdc637129e1b6bfcb9bcb3c883ed835e..88e0fc0136e1abb48efbf3699d8b364c38c5cb66 100644 (file)
@@ -852,7 +852,7 @@ reswitch:
                n->type = types[TINT];
                goto ret;
 
-       case OCMPLX:
+       case OCOMPLEX:
                ok |= Erv;
                if(twoarg(n) < 0)
                        goto error;
@@ -865,7 +865,7 @@ reswitch:
                n->right = r;
                if(l->type->etype != r->type->etype) {
                badcmplx:
-                       yyerror("invalid operation: %#N (cmplx of types %T, %T)", n, l->type, r->type);
+                       yyerror("invalid operation: %#N (complex of types %T, %T)", n, l->type, r->type);
                        goto error;
                }
                switch(l->type->etype) {
@@ -874,9 +874,6 @@ reswitch:
                case TIDEAL:
                        t = types[TIDEAL];
                        break;
-               case TFLOAT:
-                       t = types[TCOMPLEX];
-                       break;
                case TFLOAT32:
                        t = types[TCOMPLEX64];
                        break;
index 1d4c5a58e39388b45c40a067bafad99ac5b891ac..8b89d9ee49a2eefe2c70262e68be2a23260ba006 100644 (file)
@@ -671,7 +671,7 @@ walkexpr(Node **np, NodeList **init)
        case OGE:
        case OGT:
        case OADD:
-       case OCMPLX:
+       case OCOMPLEX:
                walkexpr(&n->left, init);
                walkexpr(&n->right, init);
                goto ret;
index 506c6e5db8ddf0751e2e3529d57cf2f31590e830..4683f806fa124482c0e7ca4b7b6fc7c61b442dfa 100644 (file)
@@ -768,10 +768,8 @@ enum {
        KindUint32,
        KindUint64,
        KindUintptr,
-       KindFloat,
        KindFloat32,
        KindFloat64,
-       KindComplex,
        KindComplex64,
        KindComplex128,
        KindArray,
@@ -1049,7 +1047,6 @@ defgotype(Sym *gotype)
                newattr(die, DW_AT_byte_size, DW_CLS_CONSTANT, bytesize, 0);
                break;
 
-       case KindFloat:
        case KindFloat32:
        case KindFloat64:
                die = newdie(&dwtypes, DW_ABRV_BASETYPE, name);
@@ -1057,7 +1054,6 @@ defgotype(Sym *gotype)
                newattr(die, DW_AT_byte_size, DW_CLS_CONSTANT, bytesize, 0);
                break;
 
-       case KindComplex:
        case KindComplex64:
        case KindComplex128:
                die = newdie(&dwtypes, DW_ABRV_BASETYPE, name);