1
0
mirror of https://github.com/golang/go synced 2024-11-21 21:14:47 -07:00

gc: delete float, complex

rename cmplx -> complex

R=ken2
CC=golang-dev
https://golang.org/cl/4071041
This commit is contained in:
Russ Cox 2011-01-19 23:08:11 -05:00
parent 5cfadeb047
commit 0849944694
20 changed files with 19 additions and 56 deletions

View File

@ -169,7 +169,7 @@ cgen(Node *n, Node *res)
case OREAL: case OREAL:
case OIMAG: case OIMAG:
case OCMPLX: case OCOMPLEX:
fatal("unexpected complex"); fatal("unexpected complex");
break; break;
@ -879,7 +879,6 @@ bgen(Node *n, int true, Prog *to)
switch(n->op) { switch(n->op) {
default: default:
def:
a = ONE; a = ONE;
if(!true) if(!true)
a = OEQ; a = OEQ;

View File

@ -17,8 +17,6 @@ Typedef typedefs[] =
"int", TINT, TINT32, "int", TINT, TINT32,
"uint", TUINT, TUINT32, "uint", TUINT, TUINT32,
"uintptr", TUINTPTR, TUINT32, "uintptr", TUINTPTR, TUINT32,
"float", TFLOAT, TFLOAT32,
"complex", TCOMPLEX, TCOMPLEX64,
0 0
}; };

View File

@ -1066,7 +1066,6 @@ allreg(uint32 b, Rgn *r)
case TFLOAT32: case TFLOAT32:
case TFLOAT64: case TFLOAT64:
case TFLOAT:
i = BtoF(~b); i = BtoF(~b);
if(i && r->cost >= 0) { if(i && r->cost >= 0) {
r->regno = i+NREG; r->regno = i+NREG;

View File

@ -17,8 +17,6 @@ Typedef typedefs[] =
"int", TINT, TINT32, "int", TINT, TINT32,
"uint", TUINT, TUINT32, "uint", TUINT, TUINT32,
"uintptr", TUINTPTR, TUINT64, "uintptr", TUINTPTR, TUINT64,
"float", TFLOAT, TFLOAT32,
"complex", TCOMPLEX, TCOMPLEX64,
0 0
}; };

View File

@ -748,7 +748,6 @@ addmove(Reg *r, int bn, int rn, int f)
case TPTR64: case TPTR64:
p1->as = AMOVQ; p1->as = AMOVQ;
break; break;
case TFLOAT:
case TFLOAT32: case TFLOAT32:
p1->as = AMOVSS; p1->as = AMOVSS;
break; break;
@ -1180,7 +1179,6 @@ allreg(uint32 b, Rgn *r)
case TFLOAT32: case TFLOAT32:
case TFLOAT64: case TFLOAT64:
case TFLOAT:
i = BtoF(~b); i = BtoF(~b);
if(i && r->cost > 0) { if(i && r->cost > 0) {
r->regno = i; r->regno = i;

View File

@ -174,7 +174,7 @@ cgen(Node *n, Node *res)
case OREAL: case OREAL:
case OIMAG: case OIMAG:
case OCMPLX: case OCOMPLEX:
fatal("unexpected complex"); fatal("unexpected complex");
return; return;

View File

@ -17,8 +17,6 @@ Typedef typedefs[] =
"int", TINT, TINT32, "int", TINT, TINT32,
"uint", TUINT, TUINT32, "uint", TUINT, TUINT32,
"uintptr", TUINTPTR, TUINT32, "uintptr", TUINTPTR, TUINT32,
"float", TFLOAT, TFLOAT32,
"complex", TCOMPLEX, TCOMPLEX64,
0 0
}; };

View File

@ -1095,7 +1095,6 @@ allreg(uint32 b, Rgn *r)
case TFLOAT32: case TFLOAT32:
case TFLOAT64: case TFLOAT64:
case TFLOAT:
break; break;
} }
return 0; return 0;

View File

@ -412,11 +412,9 @@ typeinit(void)
isfloat[TFLOAT32] = 1; isfloat[TFLOAT32] = 1;
isfloat[TFLOAT64] = 1; isfloat[TFLOAT64] = 1;
isfloat[TFLOAT] = 1;
iscomplex[TCOMPLEX64] = 1; iscomplex[TCOMPLEX64] = 1;
iscomplex[TCOMPLEX128] = 1; iscomplex[TCOMPLEX128] = 1;
iscomplex[TCOMPLEX] = 1;
isptr[TPTR32] = 1; isptr[TPTR32] = 1;
isptr[TPTR64] = 1; isptr[TPTR64] = 1;

View File

@ -980,10 +980,10 @@ defaultlit(Node **np, Type *t)
n->type = types[TINT]; n->type = types[TINT];
goto num; goto num;
case CTFLT: case CTFLT:
n->type = types[TFLOAT]; n->type = types[TFLOAT64];
goto num; goto num;
case CTCPLX: case CTCPLX:
n->type = types[TCOMPLEX]; n->type = types[TCOMPLEX128];
goto num; goto num;
num: num:
if(t != T) { if(t != T) {
@ -1034,13 +1034,13 @@ defaultlit2(Node **lp, Node **rp, int force)
if(!force) if(!force)
return; return;
if(isconst(l, CTCPLX) || isconst(r, CTCPLX)) { if(isconst(l, CTCPLX) || isconst(r, CTCPLX)) {
convlit(lp, types[TCOMPLEX]); convlit(lp, types[TCOMPLEX128]);
convlit(rp, types[TCOMPLEX]); convlit(rp, types[TCOMPLEX128]);
return; return;
} }
if(isconst(l, CTFLT) || isconst(r, CTFLT)) { if(isconst(l, CTFLT) || isconst(r, CTFLT)) {
convlit(lp, types[TFLOAT]); convlit(lp, types[TFLOAT64]);
convlit(rp, types[TFLOAT]); convlit(rp, types[TFLOAT64]);
return; return;
} }
convlit(lp, types[TINT]); convlit(lp, types[TINT]);

View File

@ -84,7 +84,7 @@ maybe:
case OSUB: case OSUB:
case OMUL: case OMUL:
case OMINUS: case OMINUS:
case OCMPLX: case OCOMPLEX:
case OREAL: case OREAL:
case OIMAG: case OIMAG:
goto yes; goto yes;
@ -120,7 +120,7 @@ complexgen(Node *n, Node *res)
// pick off float/complex opcodes // pick off float/complex opcodes
switch(n->op) { switch(n->op) {
case OCMPLX: case OCOMPLEX:
if(res->addable) { if(res->addable) {
subnode(&n1, &n2, res); subnode(&n1, &n2, res);
tempname(&tmp, n1.type); tempname(&tmp, n1.type);
@ -195,7 +195,7 @@ complexgen(Node *n, Node *res)
case OSUB: case OSUB:
case OMUL: case OMUL:
case OMINUS: case OMINUS:
case OCMPLX: case OCOMPLEX:
case OREAL: case OREAL:
case OIMAG: case OIMAG:
break; break;

View File

@ -390,7 +390,7 @@ enum
ORUNESTR, ORUNESTR,
OSELRECV, OSELRECV,
OIOTA, OIOTA,
OREAL, OIMAG, OCMPLX, OREAL, OIMAG, OCOMPLEX,
// stmts // stmts
OBLOCK, OBLOCK,
@ -440,11 +440,9 @@ enum
TCOMPLEX64, // 12 TCOMPLEX64, // 12
TCOMPLEX128, TCOMPLEX128,
TCOMPLEX,
TFLOAT32, // 15 TFLOAT32, // 15
TFLOAT64, TFLOAT64,
TFLOAT,
TBOOL, // 18 TBOOL, // 18

View File

@ -1531,7 +1531,7 @@ static struct
"cap", LNAME, Txxx, OCAP, "cap", LNAME, Txxx, OCAP,
"close", LNAME, Txxx, OCLOSE, "close", LNAME, Txxx, OCLOSE,
"closed", LNAME, Txxx, OCLOSED, "closed", LNAME, Txxx, OCLOSED,
"cmplx", LNAME, Txxx, OCMPLX, "complex", LNAME, Txxx, OCOMPLEX,
"copy", LNAME, Txxx, OCOPY, "copy", LNAME, Txxx, OCOPY,
"imag", LNAME, Txxx, OIMAG, "imag", LNAME, Txxx, OIMAG,
"len", LNAME, Txxx, OLEN, "len", LNAME, Txxx, OLEN,

View File

@ -365,8 +365,8 @@ exprfmt(Fmt *f, Node *n, int prec)
fmtprint(f, ")"); fmtprint(f, ")");
break; break;
case OCMPLX: case OCOMPLEX:
fmtprint(f, "cmplx("); fmtprint(f, "complex(");
exprfmt(f, n->left, 0); exprfmt(f, n->left, 0);
fmtprint(f, ", "); fmtprint(f, ", ");
exprfmt(f, n->right, 0); exprfmt(f, n->right, 0);

View File

@ -419,10 +419,8 @@ enum {
KindUint32, KindUint32,
KindUint64, KindUint64,
KindUintptr, KindUintptr,
KindFloat,
KindFloat32, KindFloat32,
KindFloat64, KindFloat64,
KindComplex,
KindComplex64, KindComplex64,
KindComplex128, KindComplex128,
KindArray, KindArray,
@ -453,7 +451,6 @@ kinds[] =
[TINT64] = KindInt64, [TINT64] = KindInt64,
[TUINT64] = KindUint64, [TUINT64] = KindUint64,
[TUINTPTR] = KindUintptr, [TUINTPTR] = KindUintptr,
[TFLOAT] = KindFloat,
[TFLOAT32] = KindFloat32, [TFLOAT32] = KindFloat32,
[TFLOAT64] = KindFloat64, [TFLOAT64] = KindFloat64,
[TBOOL] = KindBool, [TBOOL] = KindBool,
@ -466,7 +463,6 @@ kinds[] =
[TMAP] = KindMap, [TMAP] = KindMap,
[TARRAY] = KindArray, [TARRAY] = KindArray,
[TFUNC] = KindFunc, [TFUNC] = KindFunc,
[TCOMPLEX] = KindComplex,
[TCOMPLEX64] = KindComplex64, [TCOMPLEX64] = KindComplex64,
[TCOMPLEX128] = KindComplex128, [TCOMPLEX128] = KindComplex128,
}; };
@ -485,10 +481,8 @@ structnames[] =
[TINT64] = "*runtime.IntType", [TINT64] = "*runtime.IntType",
[TUINT64] = "*runtime.UintType", [TUINT64] = "*runtime.UintType",
[TUINTPTR] = "*runtime.UintType", [TUINTPTR] = "*runtime.UintType",
[TCOMPLEX] = "*runtime.ComplexType",
[TCOMPLEX64] = "*runtime.ComplexType", [TCOMPLEX64] = "*runtime.ComplexType",
[TCOMPLEX128] = "*runtime.ComplexType", [TCOMPLEX128] = "*runtime.ComplexType",
[TFLOAT] = "*runtime.FloatType",
[TFLOAT32] = "*runtime.FloatType", [TFLOAT32] = "*runtime.FloatType",
[TFLOAT64] = "*runtime.FloatType", [TFLOAT64] = "*runtime.FloatType",
[TBOOL] = "*runtime.BoolType", [TBOOL] = "*runtime.BoolType",
@ -542,7 +536,6 @@ haspointers(Type *t)
case TINT64: case TINT64:
case TUINT64: case TUINT64:
case TUINTPTR: case TUINTPTR:
case TFLOAT:
case TFLOAT32: case TFLOAT32:
case TFLOAT64: case TFLOAT64:
case TBOOL: case TBOOL:

View File

@ -917,14 +917,12 @@ gen_as_init(Node *n)
case TPTR64: case TPTR64:
case TFLOAT32: case TFLOAT32:
case TFLOAT64: case TFLOAT64:
case TFLOAT:
gused(N); // in case the data is the dest of a goto gused(N); // in case the data is the dest of a goto
gdata(&nam, nr, nr->type->width); gdata(&nam, nr, nr->type->width);
break; break;
case TCOMPLEX64: case TCOMPLEX64:
case TCOMPLEX128: case TCOMPLEX128:
case TCOMPLEX:
gused(N); // in case the data is the dest of a goto gused(N); // in case the data is the dest of a goto
gdatacomplex(&nam, nr->val.u.cval); gdatacomplex(&nam, nr->val.u.cval);
break; break;

View File

@ -836,7 +836,7 @@ goopnames[] =
[OCASE] = "case", [OCASE] = "case",
[OCLOSED] = "closed", [OCLOSED] = "closed",
[OCLOSE] = "close", [OCLOSE] = "close",
[OCMPLX] = "cmplx", [OCOMPLEX] = "complex",
[OCOM] = "^", [OCOM] = "^",
[OCONTINUE] = "continue", [OCONTINUE] = "continue",
[OCOPY] = "copy", [OCOPY] = "copy",
@ -993,10 +993,8 @@ etnames[] =
[TINT64] = "INT64", [TINT64] = "INT64",
[TUINT64] = "UINT64", [TUINT64] = "UINT64",
[TUINTPTR] = "UINTPTR", [TUINTPTR] = "UINTPTR",
[TFLOAT] = "FLOAT",
[TFLOAT32] = "FLOAT32", [TFLOAT32] = "FLOAT32",
[TFLOAT64] = "FLOAT64", [TFLOAT64] = "FLOAT64",
[TCOMPLEX] = "COMPLEX",
[TCOMPLEX64] = "COMPLEX64", [TCOMPLEX64] = "COMPLEX64",
[TCOMPLEX128] = "COMPLEX128", [TCOMPLEX128] = "COMPLEX128",
[TBOOL] = "BOOL", [TBOOL] = "BOOL",
@ -1117,10 +1115,8 @@ basicnames[] =
[TINT64] = "int64", [TINT64] = "int64",
[TUINT64] = "uint64", [TUINT64] = "uint64",
[TUINTPTR] = "uintptr", [TUINTPTR] = "uintptr",
[TFLOAT] = "float",
[TFLOAT32] = "float32", [TFLOAT32] = "float32",
[TFLOAT64] = "float64", [TFLOAT64] = "float64",
[TCOMPLEX] = "complex",
[TCOMPLEX64] = "complex64", [TCOMPLEX64] = "complex64",
[TCOMPLEX128] = "complex128", [TCOMPLEX128] = "complex128",
[TBOOL] = "bool", [TBOOL] = "bool",
@ -1752,8 +1748,6 @@ int
cplxsubtype(int et) cplxsubtype(int et)
{ {
switch(et) { switch(et) {
case TCOMPLEX:
return TFLOAT;
case TCOMPLEX64: case TCOMPLEX64:
return TFLOAT32; return TFLOAT32;
case TCOMPLEX128: case TCOMPLEX128:

View File

@ -852,7 +852,7 @@ reswitch:
n->type = types[TINT]; n->type = types[TINT];
goto ret; goto ret;
case OCMPLX: case OCOMPLEX:
ok |= Erv; ok |= Erv;
if(twoarg(n) < 0) if(twoarg(n) < 0)
goto error; goto error;
@ -865,7 +865,7 @@ reswitch:
n->right = r; n->right = r;
if(l->type->etype != r->type->etype) { if(l->type->etype != r->type->etype) {
badcmplx: 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; goto error;
} }
switch(l->type->etype) { switch(l->type->etype) {
@ -874,9 +874,6 @@ reswitch:
case TIDEAL: case TIDEAL:
t = types[TIDEAL]; t = types[TIDEAL];
break; break;
case TFLOAT:
t = types[TCOMPLEX];
break;
case TFLOAT32: case TFLOAT32:
t = types[TCOMPLEX64]; t = types[TCOMPLEX64];
break; break;

View File

@ -671,7 +671,7 @@ walkexpr(Node **np, NodeList **init)
case OGE: case OGE:
case OGT: case OGT:
case OADD: case OADD:
case OCMPLX: case OCOMPLEX:
walkexpr(&n->left, init); walkexpr(&n->left, init);
walkexpr(&n->right, init); walkexpr(&n->right, init);
goto ret; goto ret;

View File

@ -768,10 +768,8 @@ enum {
KindUint32, KindUint32,
KindUint64, KindUint64,
KindUintptr, KindUintptr,
KindFloat,
KindFloat32, KindFloat32,
KindFloat64, KindFloat64,
KindComplex,
KindComplex64, KindComplex64,
KindComplex128, KindComplex128,
KindArray, KindArray,
@ -1049,7 +1047,6 @@ defgotype(Sym *gotype)
newattr(die, DW_AT_byte_size, DW_CLS_CONSTANT, bytesize, 0); newattr(die, DW_AT_byte_size, DW_CLS_CONSTANT, bytesize, 0);
break; break;
case KindFloat:
case KindFloat32: case KindFloat32:
case KindFloat64: case KindFloat64:
die = newdie(&dwtypes, DW_ABRV_BASETYPE, name); 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); newattr(die, DW_AT_byte_size, DW_CLS_CONSTANT, bytesize, 0);
break; break;
case KindComplex:
case KindComplex64: case KindComplex64:
case KindComplex128: case KindComplex128:
die = newdie(&dwtypes, DW_ABRV_BASETYPE, name); die = newdie(&dwtypes, DW_ABRV_BASETYPE, name);