rename TypeMethod and the struct type enums

This commit is contained in:
Ash Wolf 2023-01-18 17:19:20 +00:00
parent a231f5dbb9
commit 5d0bbb19cc
22 changed files with 212 additions and 227 deletions

View File

@ -407,7 +407,7 @@ static void CABI_AllocateVTable(DeclE *decle, TypeClass *tclass) {
CError_ASSERT(714, objbase = decle->objlist[i]); CError_ASSERT(714, objbase = decle->objlist[i]);
if (objbase->otype == OT_OBJECT && OBJECT(objbase)->datatype == DVFUNC) { if (objbase->otype == OT_OBJECT && OBJECT(objbase)->datatype == DVFUNC) {
TypeMethod *tmethod = TYPE_METHOD(OBJECT(objbase)->type); TypeMemberFunc *tmethod = TYPE_METHOD(OBJECT(objbase)->type);
Object *baseobj = CABI_FindZeroVirtualBaseMember(tclass, OBJECT(objbase)); Object *baseobj = CABI_FindZeroVirtualBaseMember(tclass, OBJECT(objbase));
if (baseobj) { if (baseobj) {

View File

@ -300,7 +300,7 @@ void CBrowse_AddClassMemberVar(ObjMemberVar *ivar, SInt32 startOffset, SInt32 en
void CBrowse_AddClassMemberFunction(Object *object, SInt32 startOffset, SInt32 endOffset) { void CBrowse_AddClassMemberFunction(Object *object, SInt32 startOffset, SInt32 endOffset) {
SInt32 flags; SInt32 flags;
SInt32 id; SInt32 id;
TypeMethod *tfunc; TypeMemberFunc *tfunc;
CError_ASSERT(380, object); CError_ASSERT(380, object);

View File

@ -227,7 +227,7 @@ Object *CClass_DummyDefaultConstructor(TypeClass *tclass) {
FuncArg *args; FuncArg *args;
NameSpaceObjectList *nsol; NameSpaceObjectList *nsol;
HashNameNode *name; HashNameNode *name;
TypeMethod *tmethod; TypeMemberFunc *tmethod;
Object *object; Object *object;
ObjectList list; ObjectList list;
@ -267,8 +267,8 @@ Object *CClass_DummyDefaultConstructor(TypeClass *tclass) {
return OBJECT(nsol->object); return OBJECT(nsol->object);
} }
tmethod = galloc(sizeof(TypeMethod)); tmethod = galloc(sizeof(TypeMemberFunc));
memclrw(tmethod, sizeof(TypeMethod)); memclrw(tmethod, sizeof(TypeMemberFunc));
tmethod->type = TYPEFUNC; tmethod->type = TYPEFUNC;
tmethod->functype = TYPE(&void_ptr); tmethod->functype = TYPE(&void_ptr);
@ -1249,9 +1249,9 @@ static TypeList *CClass_GetCoVariantClassList(TypeList *list, TypeClass *tclass,
return list; return list;
} }
static TypeMethod *CClass_GetCovariantType(TypeMethod *tmethod, Type *type) { static TypeMemberFunc *CClass_GetCovariantType(TypeMemberFunc *tmethod, Type *type) {
TypePointer *tptr; TypePointer *tptr;
TypeMethod *result; TypeMemberFunc *result;
CError_ASSERT(1724, CError_ASSERT(1724,
IS_TYPE_METHOD(tmethod) && IS_TYPE_METHOD(tmethod) &&
@ -1261,7 +1261,7 @@ static TypeMethod *CClass_GetCovariantType(TypeMethod *tmethod, Type *type) {
*tptr = *TYPE_POINTER(tmethod->functype); *tptr = *TYPE_POINTER(tmethod->functype);
tptr->target = type; tptr->target = type;
result = galloc(sizeof(TypeMethod)); result = galloc(sizeof(TypeMemberFunc));
*result = *tmethod; *result = *tmethod;
result->flags &= ~(FUNC_FLAGS_20 | FUNC_FLAGS_400000); result->flags &= ~(FUNC_FLAGS_20 | FUNC_FLAGS_400000);
result->functype = TYPE(tptr); result->functype = TYPE(tptr);

View File

@ -1413,7 +1413,7 @@ Object *CDecl_GetFunctionObject(DeclInfo *declinfo, NameSpace *nspace, Boolean *
Type *type; Type *type;
NameSpace *nspace2; NameSpace *nspace2;
NameSpaceObjectList *list; NameSpaceObjectList *list;
TypeMethod tmp; TypeMemberFunc tmp;
Boolean outflag; Boolean outflag;
r27 = 0; r27 = 0;
@ -3138,11 +3138,11 @@ void CDecl_ExtractClassExportFlags(DeclInfo *declinfo, UInt8 flags) {
declinfo->exportflags |= EXPORT_FLAGS_EXPORT; declinfo->exportflags |= EXPORT_FLAGS_EXPORT;
} }
TypeMethod *CDecl_MakeTypeMemberFunc(TypeFunc *tfunc, TypeClass *tclass, Boolean flag) { TypeMemberFunc *CDecl_MakeTypeMemberFunc(TypeFunc *tfunc, TypeClass *tclass, Boolean flag) {
TypeMethod *method; TypeMemberFunc *method;
method = galloc(sizeof(TypeMethod)); method = galloc(sizeof(TypeMemberFunc));
memclrw(method, sizeof(TypeMethod)); memclrw(method, sizeof(TypeMemberFunc));
*TYPE_FUNC(method) = *tfunc; *TYPE_FUNC(method) = *tfunc;
method->theclass = tclass; method->theclass = tclass;
method->x26 = flag; method->x26 = flag;
@ -3167,7 +3167,7 @@ static void CDecl_MakeFunctionVirtual(TypeClass *tclass, Object *func) {
static void CDecl_AddFunctionMember(DeclE *decle, TypeClass *tclass, DeclInfo *declinfo, short access, Boolean flag1, Boolean flag2, Boolean flag3, Boolean flag4) { static void CDecl_AddFunctionMember(DeclE *decle, TypeClass *tclass, DeclInfo *declinfo, short access, Boolean flag1, Boolean flag2, Boolean flag3, Boolean flag4) {
NameSpaceObjectList *list; // r20 NameSpaceObjectList *list; // r20
Object *obj; // also r20 Object *obj; // also r20
TypeMethod *tfunc; // r19 TypeMemberFunc *tfunc; // r19
Boolean r31; Boolean r31;
Boolean outflag; Boolean outflag;
@ -4200,9 +4200,9 @@ static short getaccesstype(AccessType a, AccessType b, AccessType c) {
return ACCESSPUBLIC; return ACCESSPUBLIC;
} }
static TypeMethod *CDecl_MakeDefaultCtorType(TypeClass *tclass) { static TypeMemberFunc *CDecl_MakeDefaultCtorType(TypeClass *tclass) {
TypeMethod *tmeth = galloc(sizeof(TypeMethod)); TypeMemberFunc *tmeth = galloc(sizeof(TypeMemberFunc));
memclrw(tmeth, sizeof(TypeMethod)); memclrw(tmeth, sizeof(TypeMemberFunc));
tmeth->type = TYPEFUNC; tmeth->type = TYPEFUNC;
tmeth->functype = TYPE(&void_ptr); tmeth->functype = TYPE(&void_ptr);
tmeth->flags = FUNC_FLAGS_1000 | FUNC_FLAGS_100 | FUNC_FLAGS_METHOD; tmeth->flags = FUNC_FLAGS_1000 | FUNC_FLAGS_100 | FUNC_FLAGS_METHOD;
@ -4220,7 +4220,7 @@ static void CDecl_AddDefArgConstructor(TypeClass *tclass) {
// empty // empty
} }
static void CDecl_AddMemberFunctionObject(TypeClass *tclass, HashNameNode *name, TypeMethod *tmeth, short access) { static void CDecl_AddMemberFunctionObject(TypeClass *tclass, HashNameNode *name, TypeMemberFunc *tmeth, short access) {
Object *obj = CParser_NewCompilerDefFunctionObject(); Object *obj = CParser_NewCompilerDefFunctionObject();
obj->name = name; obj->name = name;
obj->type = TYPE(tmeth); obj->type = TYPE(tmeth);
@ -4272,10 +4272,10 @@ static void CDecl_AddDefaultConstructor(DeclE *decle, TypeClass *tclass) {
} }
} }
static TypeMethod *CDecl_MakeCopyCtorType(TypeClass *tclass, Boolean is_const) { static TypeMemberFunc *CDecl_MakeCopyCtorType(TypeClass *tclass, Boolean is_const) {
FuncArg *arg; FuncArg *arg;
TypeMethod *tmeth = galloc(sizeof(TypeMethod)); TypeMemberFunc *tmeth = galloc(sizeof(TypeMemberFunc));
memclrw(tmeth, sizeof(TypeMethod)); memclrw(tmeth, sizeof(TypeMemberFunc));
tmeth->type = TYPEFUNC; tmeth->type = TYPEFUNC;
tmeth->functype = TYPE(&void_ptr); tmeth->functype = TYPE(&void_ptr);
tmeth->flags = FUNC_FLAGS_1000 | FUNC_FLAGS_100 | FUNC_FLAGS_METHOD; tmeth->flags = FUNC_FLAGS_1000 | FUNC_FLAGS_100 | FUNC_FLAGS_METHOD;
@ -4353,10 +4353,10 @@ static void CDecl_AddDefaultCopyConstructor(DeclE *decle, TypeClass *tclass) {
} }
} }
static TypeMethod *CDecl_MakeAssignmentOperatorType(TypeClass *tclass, Boolean is_const) { static TypeMemberFunc *CDecl_MakeAssignmentOperatorType(TypeClass *tclass, Boolean is_const) {
FuncArg *arg; FuncArg *arg;
TypeMethod *tmeth = galloc(sizeof(TypeMethod)); TypeMemberFunc *tmeth = galloc(sizeof(TypeMemberFunc));
memclrw(tmeth, sizeof(TypeMethod)); memclrw(tmeth, sizeof(TypeMemberFunc));
tmeth->type = TYPEFUNC; tmeth->type = TYPEFUNC;
tmeth->functype = CDecl_NewRefPointerType(TYPE(tclass)); tmeth->functype = CDecl_NewRefPointerType(TYPE(tclass));
tmeth->flags = FUNC_FLAGS_100 | FUNC_FLAGS_METHOD; tmeth->flags = FUNC_FLAGS_100 | FUNC_FLAGS_METHOD;
@ -4424,9 +4424,9 @@ static void CDecl_AddDefaultAssignmentOperator(DeclE *decle, TypeClass *tclass)
} }
} }
TypeMethod *CDecl_MakeDefaultDtorType(TypeClass *tclass, Boolean is_virtual) { TypeMemberFunc *CDecl_MakeDefaultDtorType(TypeClass *tclass, Boolean is_virtual) {
TypeMethod *tmeth = galloc(sizeof(TypeMethod)); TypeMemberFunc *tmeth = galloc(sizeof(TypeMemberFunc));
memclrw(tmeth, sizeof(TypeMethod)); memclrw(tmeth, sizeof(TypeMemberFunc));
tmeth->type = TYPEFUNC; tmeth->type = TYPEFUNC;
tmeth->functype = (Type *) &void_ptr; tmeth->functype = (Type *) &void_ptr;
tmeth->flags = FUNC_FLAGS_2000 | FUNC_FLAGS_100 | FUNC_FLAGS_METHOD; tmeth->flags = FUNC_FLAGS_2000 | FUNC_FLAGS_100 | FUNC_FLAGS_METHOD;

View File

@ -374,17 +374,17 @@ void CError_BufferAppendType(CErrorBuffer *eb, Type *ty, UInt32 qual) {
case STRUCT_TYPE_UNION: case STRUCT_TYPE_UNION:
CError_BufferAppendString(eb, "union "); CError_BufferAppendString(eb, "union ");
break; break;
case STRUCT_TYPE_4: case STRUCT_VECTOR_UCHAR:
case STRUCT_TYPE_5: case STRUCT_VECTOR_SCHAR:
case STRUCT_TYPE_6: case STRUCT_VECTOR_BCHAR:
case STRUCT_TYPE_7: case STRUCT_VECTOR_USHORT:
case STRUCT_TYPE_8: case STRUCT_VECTOR_SSHORT:
case STRUCT_TYPE_9: case STRUCT_VECTOR_BSHORT:
case STRUCT_TYPE_A: case STRUCT_VECTOR_UINT:
case STRUCT_TYPE_B: case STRUCT_VECTOR_SINT:
case STRUCT_TYPE_C: case STRUCT_VECTOR_BINT:
case STRUCT_TYPE_D: case STRUCT_VECTOR_FLOAT:
case STRUCT_TYPE_E: case STRUCT_VECTOR_PIXEL:
break; break;
default: default:
CError_FATAL(618); CError_FATAL(618);

View File

@ -950,7 +950,7 @@ ENode *CExpr_MakeNameLookupResultExpr(CScopeParseResult *pr) {
static Type *CExpr_NewPTMType(EMemberInfo *member, Object *obj) { static Type *CExpr_NewPTMType(EMemberInfo *member, Object *obj) {
TypeMemberPointer *ptm; TypeMemberPointer *ptm;
TypeMethod *tmethod; TypeMemberFunc *tmethod;
BClassList *path; BClassList *path;
ptm = galloc(sizeof(TypeMemberPointer)); ptm = galloc(sizeof(TypeMemberPointer));
@ -971,8 +971,8 @@ static Type *CExpr_NewPTMType(EMemberInfo *member, Object *obj) {
CError_ASSERT(1308, IS_TYPE_FUNC(obj->type)); CError_ASSERT(1308, IS_TYPE_FUNC(obj->type));
} }
tmethod = galloc(sizeof(TypeMethod)); tmethod = galloc(sizeof(TypeMemberFunc));
memclrw(tmethod, sizeof(TypeMethod)); memclrw(tmethod, sizeof(TypeMemberFunc));
*tmethod = *TYPE_METHOD(obj->type); *tmethod = *TYPE_METHOD(obj->type);
CError_ASSERT(1312, tmethod->args); CError_ASSERT(1312, tmethod->args);
@ -1376,15 +1376,15 @@ static ENode *CExpr_ParseVecStep(void) {
CDecl_CompleteType(type); CDecl_CompleteType(type);
if (IS_TYPE_VECTOR(type)) { if (IS_TYPE_VECTOR(type)) {
switch (TYPE_STRUCT(type)->stype) { switch (TYPE_STRUCT(type)->stype) {
case STRUCT_TYPE_4: case STRUCT_VECTOR_UCHAR:
case STRUCT_TYPE_5: case STRUCT_VECTOR_SCHAR:
case STRUCT_TYPE_6: case STRUCT_VECTOR_BCHAR:
value = 16; value = 16;
break; break;
case STRUCT_TYPE_7: case STRUCT_VECTOR_USHORT:
case STRUCT_TYPE_8: case STRUCT_VECTOR_SSHORT:
case STRUCT_TYPE_9: case STRUCT_VECTOR_BSHORT:
case STRUCT_TYPE_E: case STRUCT_VECTOR_PIXEL:
value = 8; value = 8;
break; break;
default: default:
@ -2013,7 +2013,7 @@ loop:
} }
goto loop; goto loop;
} }
if (!IS_TYPE_STRUCT(expr->rtype) || TYPE_STRUCT(expr->rtype)->stype > STRUCT_TYPE_3) { if (!IS_TYPE_STRUCT(expr->rtype) || TYPE_STRUCT(expr->rtype)->stype > STRUCT_TYPE_MAX) {
if (copts.cplusplus && (subexpr = CExpr_DummyDestr(expr))) if (copts.cplusplus && (subexpr = CExpr_DummyDestr(expr)))
return subexpr; return subexpr;
CError_ErrorSkip(CErrorStr149); CError_ErrorSkip(CErrorStr149);
@ -2296,7 +2296,7 @@ ENode *getpointertomemberfunc(ENode *expr, Type *type, Boolean flag) {
Object *obj; Object *obj;
Object *dataobj; Object *dataobj;
Type *ptmtype; Type *ptmtype;
TypeMethod *tmethod; TypeMemberFunc *tmethod;
OLinkList *olist; OLinkList *olist;
SInt32 data[3]; SInt32 data[3];

View File

@ -1810,7 +1810,7 @@ short user_assign_check(ENode *expr, Type *type, UInt32 qual, Boolean flag1, Boo
short r14b; short r14b;
TypeFunc *r14c; TypeFunc *r14c;
ENodeList *r14d; ENodeList *r14d;
TypeMethod *r13; TypeMemberFunc *r13;
ENodeList *r13b; ENodeList *r13b;
short result; short result;
FuncArg *arg; FuncArg *arg;

View File

@ -900,9 +900,9 @@ static void CInit_InitTypeStruct(CInit_Stuff *s, CInit_Stuff2 *s2, const TypeStr
tk = lex(); tk = lex();
if (IS_TYPESTRUCT_VECTOR(tstruct)) { if (IS_TYPESTRUCT_VECTOR(tstruct)) {
switch (TYPE_STRUCT(tstruct)->stype) { switch (TYPE_STRUCT(tstruct)->stype) {
case STRUCT_TYPE_4: case STRUCT_VECTOR_UCHAR:
case STRUCT_TYPE_5: case STRUCT_VECTOR_SCHAR:
case STRUCT_TYPE_6: case STRUCT_VECTOR_BCHAR:
if (count != 16) { if (count != 16) {
if (count == 1) { if (count == 1) {
UInt8 val, *p; UInt8 val, *p;
@ -915,10 +915,10 @@ static void CInit_InitTypeStruct(CInit_Stuff *s, CInit_Stuff2 *s2, const TypeStr
} }
} }
break; break;
case STRUCT_TYPE_7: case STRUCT_VECTOR_USHORT:
case STRUCT_TYPE_8: case STRUCT_VECTOR_SSHORT:
case STRUCT_TYPE_9: case STRUCT_VECTOR_BSHORT:
case STRUCT_TYPE_E: case STRUCT_VECTOR_PIXEL:
if (count != 8) { if (count != 8) {
if (count == 1) { if (count == 1) {
SInt16 val, *p; SInt16 val, *p;
@ -931,10 +931,10 @@ static void CInit_InitTypeStruct(CInit_Stuff *s, CInit_Stuff2 *s2, const TypeStr
} }
} }
break; break;
case STRUCT_TYPE_A: case STRUCT_VECTOR_UINT:
case STRUCT_TYPE_B: case STRUCT_VECTOR_SINT:
case STRUCT_TYPE_C: case STRUCT_VECTOR_BINT:
case STRUCT_TYPE_D: case STRUCT_VECTOR_FLOAT:
if (count != 4) { if (count != 4) {
if (count == 1) { if (count == 1) {
UInt32 val, *p; UInt32 val, *p;

View File

@ -95,23 +95,23 @@ static StructMember stVF_float2 = {&stVF_float3, (Type *) &stfloat, NULL, 8, 0};
static StructMember stVF_float1 = {&stVF_float2, (Type *) &stfloat, NULL, 4, 0}; static StructMember stVF_float1 = {&stVF_float2, (Type *) &stfloat, NULL, 4, 0};
static StructMember stVF_float0 = {&stVF_float1, (Type *) &stfloat, NULL, 0, 0}; static StructMember stVF_float0 = {&stVF_float1, (Type *) &stfloat, NULL, 0, 0};
TypeStruct stvectorunsignedchar = {TYPESTRUCT, 16, NULL, &stVUC_unsignedchar0, STRUCT_TYPE_4, 16}; TypeStruct stvectorunsignedchar = {TYPESTRUCT, 16, NULL, &stVUC_unsignedchar0, STRUCT_VECTOR_UCHAR, 16};
TypeStruct stvectorsignedchar = {TYPESTRUCT, 16, NULL, &stVSC_signedchar0, STRUCT_TYPE_5, 16}; TypeStruct stvectorsignedchar = {TYPESTRUCT, 16, NULL, &stVSC_signedchar0, STRUCT_VECTOR_SCHAR, 16};
TypeStruct stvectorboolchar = {TYPESTRUCT, 16, NULL, &stVSC_signedchar0, STRUCT_TYPE_6, 16}; TypeStruct stvectorboolchar = {TYPESTRUCT, 16, NULL, &stVSC_signedchar0, STRUCT_VECTOR_BCHAR, 16};
TypeStruct stvectorunsignedshort = {TYPESTRUCT, 16, NULL, &stVUS_unsignedshort0, STRUCT_TYPE_7, 16}; TypeStruct stvectorunsignedshort = {TYPESTRUCT, 16, NULL, &stVUS_unsignedshort0, STRUCT_VECTOR_USHORT, 16};
TypeStruct stvectorsignedshort = {TYPESTRUCT, 16, NULL, &stVSS_signedshort0, STRUCT_TYPE_8, 16}; TypeStruct stvectorsignedshort = {TYPESTRUCT, 16, NULL, &stVSS_signedshort0, STRUCT_VECTOR_SSHORT, 16};
TypeStruct stvectorboolshort = {TYPESTRUCT, 16, NULL, &stVSS_signedshort0, STRUCT_TYPE_9, 16}; TypeStruct stvectorboolshort = {TYPESTRUCT, 16, NULL, &stVSS_signedshort0, STRUCT_VECTOR_BSHORT, 16};
TypeStruct stvectorunsignedlong = {TYPESTRUCT, 16, NULL, &stVUL_unsignedlong0, STRUCT_TYPE_A, 16}; TypeStruct stvectorunsignedlong = {TYPESTRUCT, 16, NULL, &stVUL_unsignedlong0, STRUCT_VECTOR_UINT, 16};
TypeStruct stvectorsignedlong = {TYPESTRUCT, 16, NULL, &stVSL_signedlong0, STRUCT_TYPE_B, 16}; TypeStruct stvectorsignedlong = {TYPESTRUCT, 16, NULL, &stVSL_signedlong0, STRUCT_VECTOR_SINT, 16};
TypeStruct stvectorboollong = {TYPESTRUCT, 16, NULL, &stVSL_signedlong0, STRUCT_TYPE_C, 16}; TypeStruct stvectorboollong = {TYPESTRUCT, 16, NULL, &stVSL_signedlong0, STRUCT_VECTOR_BINT, 16};
TypeStruct stvectorfloat = {TYPESTRUCT, 16, NULL, &stVF_float0, STRUCT_TYPE_D, 16}; TypeStruct stvectorfloat = {TYPESTRUCT, 16, NULL, &stVF_float0, STRUCT_VECTOR_FLOAT, 16};
TypeStruct stvectorpixel = {TYPESTRUCT, 16, NULL, &stVUS_unsignedshort0, STRUCT_TYPE_E, 16}; TypeStruct stvectorpixel = {TYPESTRUCT, 16, NULL, &stVUS_unsignedshort0, STRUCT_VECTOR_PIXEL, 16};
TypeStruct stvector = {TYPESTRUCT, 16, NULL, NULL, STRUCT_TYPE_A, 16}; TypeStruct stvector = {TYPESTRUCT, 16, NULL, NULL, STRUCT_VECTOR_UINT, 16};
static SInt32 cmach_structoffset; static SInt32 cmach_structoffset;
static UInt8 cmach_structalign; static UInt8 cmach_structalign;
@ -217,7 +217,7 @@ SInt32 CMach_AllocationAlignment(Type *type, UInt32 qual) {
align = anotheralign; align = anotheralign;
if (copts.optimizationlevel > 0) { if (copts.optimizationlevel > 0) {
if (type->type == TYPEARRAY || (type->type == TYPESTRUCT && (TYPE_STRUCT(type)->stype < STRUCT_TYPE_4 || TYPE_STRUCT(type)->stype > STRUCT_TYPE_E)) || type->type == TYPECLASS || (type->type == TYPEMEMBERPOINTER && (UInt32) type->size == 12)) { if (type->type == TYPEARRAY || (type->type == TYPESTRUCT && (TYPE_STRUCT(type)->stype < STRUCT_VECTOR_UCHAR || TYPE_STRUCT(type)->stype > STRUCT_VECTOR_PIXEL)) || type->type == TYPECLASS || (type->type == TYPEMEMBERPOINTER && (UInt32) type->size == 12)) {
return (copts.min_struct_alignment > align) ? copts.min_struct_alignment : align; return (copts.min_struct_alignment > align) ? copts.min_struct_alignment : align;
} }
} }
@ -581,29 +581,29 @@ void CMach_InitVectorMem(Type *type, MWVector128 val, void *mem, Boolean flag) {
switch (type->type) { switch (type->type) {
case TYPESTRUCT: case TYPESTRUCT:
switch (TYPE_STRUCT(type)->stype) { switch (TYPE_STRUCT(type)->stype) {
case STRUCT_TYPE_4: case STRUCT_VECTOR_UCHAR:
case STRUCT_TYPE_5: case STRUCT_VECTOR_SCHAR:
case STRUCT_TYPE_6: case STRUCT_VECTOR_BCHAR:
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
uc[i] = val.uc[i]; uc[i] = val.uc[i];
memcpy(mem, uc, 16); memcpy(mem, uc, 16);
break; break;
case STRUCT_TYPE_7: case STRUCT_VECTOR_USHORT:
case STRUCT_TYPE_8: case STRUCT_VECTOR_SSHORT:
case STRUCT_TYPE_9: case STRUCT_VECTOR_BSHORT:
case STRUCT_TYPE_E: case STRUCT_VECTOR_PIXEL:
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
us[i] = val.us[i]; us[i] = val.us[i];
memcpy(mem, us, 16); memcpy(mem, us, 16);
break; break;
case STRUCT_TYPE_A: case STRUCT_VECTOR_UINT:
case STRUCT_TYPE_B: case STRUCT_VECTOR_SINT:
case STRUCT_TYPE_C: case STRUCT_VECTOR_BINT:
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
ul[i] = val.ul[i]; ul[i] = val.ul[i];
memcpy(mem, ul, 16); memcpy(mem, ul, 16);
break; break;
case STRUCT_TYPE_D: case STRUCT_VECTOR_FLOAT:
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
f[i] = val.f[i]; f[i] = val.f[i];
memcpy(mem, f, 16); memcpy(mem, f, 16);
@ -841,7 +841,7 @@ static SInt16 CMach_GetQualifiedStructAlign(const TypeStruct *tstruct, Boolean f
SInt32 align; SInt32 align;
Boolean isFirst; Boolean isFirst;
if (tstruct->stype >= STRUCT_TYPE_4 && tstruct->stype <= STRUCT_TYPE_E) if (tstruct->stype >= STRUCT_VECTOR_UCHAR && tstruct->stype <= STRUCT_VECTOR_PIXEL)
return 16; return 16;
switch (copts.structalignment) { switch (copts.structalignment) {
@ -1030,7 +1030,7 @@ static SInt16 CMach_GetQualifiedTypeAlign(Type *type, Boolean flag) {
Boolean isWin; Boolean isWin;
SInt16 align; SInt16 align;
if (type->type == TYPESTRUCT && TYPE_STRUCT(type)->stype >= STRUCT_TYPE_4 && TYPE_STRUCT(type)->stype <= STRUCT_TYPE_E) if (type->type == TYPESTRUCT && TYPE_STRUCT(type)->stype >= STRUCT_VECTOR_UCHAR && TYPE_STRUCT(type)->stype <= STRUCT_VECTOR_PIXEL)
return 16; return 16;
switch (copts.structalignment) { switch (copts.structalignment) {
@ -1295,7 +1295,7 @@ static Boolean CMach_IsTrivialClass(TypeClass *tclass) {
UInt8 CMach_GetFunctionResultClass(TypeFunc *tfunc) { UInt8 CMach_GetFunctionResultClass(TypeFunc *tfunc) {
switch (tfunc->functype->type) { switch (tfunc->functype->type) {
case TYPESTRUCT: case TYPESTRUCT:
if (tfunc->functype->type == TYPESTRUCT && TYPE_STRUCT(tfunc->functype)->stype >= STRUCT_TYPE_4 && TYPE_STRUCT(tfunc->functype)->stype <= STRUCT_TYPE_E) if (tfunc->functype->type == TYPESTRUCT && TYPE_STRUCT(tfunc->functype)->stype >= STRUCT_VECTOR_UCHAR && TYPE_STRUCT(tfunc->functype)->stype <= STRUCT_VECTOR_PIXEL)
return 0; return 0;
case TYPECLASS: case TYPECLASS:
case TYPEMEMBERPOINTER: case TYPEMEMBERPOINTER:
@ -1308,7 +1308,7 @@ UInt8 CMach_GetFunctionResultClass(TypeFunc *tfunc) {
Boolean CMach_PassResultInHiddenArg(Type *type) { Boolean CMach_PassResultInHiddenArg(Type *type) {
switch (type->type) { switch (type->type) {
case TYPESTRUCT: case TYPESTRUCT:
if (TYPE_STRUCT(type)->stype >= STRUCT_TYPE_4 && TYPE_STRUCT(type)->stype <= STRUCT_TYPE_E) if (TYPE_STRUCT(type)->stype >= STRUCT_VECTOR_UCHAR && TYPE_STRUCT(type)->stype <= STRUCT_VECTOR_PIXEL)
return 0; return 0;
else else
return 1; return 1;

View File

@ -432,37 +432,37 @@ static void CMangler_MangleTypeAppend(Type *type, UInt32 qual) {
case TYPESTRUCT: case TYPESTRUCT:
CMangler_MangleQualifier(qual); CMangler_MangleQualifier(qual);
switch (TYPE_STRUCT(type)->stype) { switch (TYPE_STRUCT(type)->stype) {
case STRUCT_TYPE_4: case STRUCT_VECTOR_UCHAR:
AppendGListName(&name_mangle_list, "XUc"); AppendGListName(&name_mangle_list, "XUc");
return; return;
case STRUCT_TYPE_5: case STRUCT_VECTOR_SCHAR:
AppendGListName(&name_mangle_list, "Xc"); AppendGListName(&name_mangle_list, "Xc");
return; return;
case STRUCT_TYPE_6: case STRUCT_VECTOR_BCHAR:
AppendGListName(&name_mangle_list, "XC"); AppendGListName(&name_mangle_list, "XC");
return; return;
case STRUCT_TYPE_7: case STRUCT_VECTOR_USHORT:
AppendGListName(&name_mangle_list, "XUs"); AppendGListName(&name_mangle_list, "XUs");
return; return;
case STRUCT_TYPE_8: case STRUCT_VECTOR_SSHORT:
AppendGListName(&name_mangle_list, "Xs"); AppendGListName(&name_mangle_list, "Xs");
return; return;
case STRUCT_TYPE_9: case STRUCT_VECTOR_BSHORT:
AppendGListName(&name_mangle_list, "XS"); AppendGListName(&name_mangle_list, "XS");
return; return;
case STRUCT_TYPE_A: case STRUCT_VECTOR_UINT:
AppendGListName(&name_mangle_list, "XUi"); AppendGListName(&name_mangle_list, "XUi");
return; return;
case STRUCT_TYPE_B: case STRUCT_VECTOR_SINT:
AppendGListName(&name_mangle_list, "Xi"); AppendGListName(&name_mangle_list, "Xi");
return; return;
case STRUCT_TYPE_C: case STRUCT_VECTOR_BINT:
AppendGListName(&name_mangle_list, "XI"); AppendGListName(&name_mangle_list, "XI");
return; return;
case STRUCT_TYPE_D: case STRUCT_VECTOR_FLOAT:
AppendGListName(&name_mangle_list, "Xf"); AppendGListName(&name_mangle_list, "Xf");
return; return;
case STRUCT_TYPE_E: case STRUCT_VECTOR_PIXEL:
AppendGListName(&name_mangle_list, "Xp"); AppendGListName(&name_mangle_list, "Xp");
return; return;
} }

View File

@ -872,7 +872,7 @@ static TypeFunc *CPrec_GetTypeFuncPatch(TypeFunc *type) {
TypeFunc *p = CPrec_AppendAlign(); TypeFunc *p = CPrec_AppendAlign();
CPrec_NewAddrPatch(type, p); CPrec_NewAddrPatch(type, p);
CPrec_AppendData(type, (type->flags & FUNC_FLAGS_METHOD) ? sizeof(TypeMethod) : sizeof(TypeFunc)); CPrec_AppendData(type, (type->flags & FUNC_FLAGS_METHOD) ? sizeof(TypeMemberFunc) : sizeof(TypeFunc));
CPrec_NewPointerPatch(&p->functype, CPrec_GetTypePatch(type->functype)); CPrec_NewPointerPatch(&p->functype, CPrec_GetTypePatch(type->functype));
if (type->args) if (type->args)

View File

@ -1906,7 +1906,7 @@ Type *CTemplTool_DeduceTypeCopy(TypeDeduce *deduce, Type *type, UInt32 *resultQu
case TYPEFUNC: case TYPEFUNC:
if (TYPE_FUNC(type)->flags & FUNC_FLAGS_METHOD) { if (TYPE_FUNC(type)->flags & FUNC_FLAGS_METHOD) {
qual2 = 0; qual2 = 0;
deduced = galloc(sizeof(TypeMethod)); deduced = galloc(sizeof(TypeMemberFunc));
*TYPE_METHOD(deduced) = *TYPE_METHOD(type); *TYPE_METHOD(deduced) = *TYPE_METHOD(type);
TYPE_METHOD(deduced)->x22 = 0; TYPE_METHOD(deduced)->x22 = 0;
TYPE_METHOD(deduced)->theclass = TYPE_CLASS(CTemplTool_DeduceTypeQualCopy(deduce, TYPE(TYPE_METHOD(type)->theclass), &qual2)); TYPE_METHOD(deduced)->theclass = TYPE_CLASS(CTemplTool_DeduceTypeQualCopy(deduce, TYPE(TYPE_METHOD(type)->theclass), &qual2));

View File

@ -1969,17 +1969,17 @@ ENode *CodeGen_HandleTypeCast(ENode *expr, Type *type, UInt32 qual) {
flags = qual & ENODE_FLAG_QUALS; flags = qual & ENODE_FLAG_QUALS;
if (IS_TYPE_STRUCT(type) && IS_TYPE_STRUCT(expr->rtype) && expr->flags == flags) { if (IS_TYPE_STRUCT(type) && IS_TYPE_STRUCT(expr->rtype) && expr->flags == flags) {
switch (TYPE_STRUCT(type)->stype) { switch (TYPE_STRUCT(type)->stype) {
case STRUCT_TYPE_4: case STRUCT_VECTOR_UCHAR:
case STRUCT_TYPE_5: case STRUCT_VECTOR_SCHAR:
case STRUCT_TYPE_6: case STRUCT_VECTOR_BCHAR:
case STRUCT_TYPE_7: case STRUCT_VECTOR_USHORT:
case STRUCT_TYPE_8: case STRUCT_VECTOR_SSHORT:
case STRUCT_TYPE_9: case STRUCT_VECTOR_BSHORT:
case STRUCT_TYPE_A: case STRUCT_VECTOR_UINT:
case STRUCT_TYPE_B: case STRUCT_VECTOR_SINT:
case STRUCT_TYPE_C: case STRUCT_VECTOR_BINT:
case STRUCT_TYPE_D: case STRUCT_VECTOR_FLOAT:
case STRUCT_TYPE_E: case STRUCT_VECTOR_PIXEL:
expr = makemonadicnode(expr, ETYPCON); expr = makemonadicnode(expr, ETYPCON);
expr->rtype = type; expr->rtype = type;
expr->flags = flags; expr->flags = flags;
@ -2026,9 +2026,9 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
escan = escan->data.diadic.left; escan = escan->data.diadic.left;
} }
switch (TYPE_STRUCT(type)->stype) { switch (TYPE_STRUCT(type)->stype) {
case STRUCT_TYPE_4: case STRUCT_VECTOR_UCHAR:
case STRUCT_TYPE_5: case STRUCT_VECTOR_SCHAR:
case STRUCT_TYPE_6: case STRUCT_VECTOR_BCHAR:
if (i < 15) { if (i < 15) {
PPCError_Error(110, type, 0); PPCError_Error(110, type, 0);
} else if (i > 15) { } else if (i > 15) {
@ -2046,7 +2046,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
} }
if (copts.pedantic) { if (copts.pedantic) {
if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_4) { if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UCHAR) {
if (!CInt64_IsInURange(v, 1)) if (!CInt64_IsInURange(v, 1))
PPCError_Warning(113, type, 0); PPCError_Warning(113, type, 0);
} else { } else {
@ -2062,7 +2062,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
if (ENODE_IS(escan, EINTCONST)) { if (ENODE_IS(escan, EINTCONST)) {
CInt64 v = escan->data.intval; CInt64 v = escan->data.intval;
if (copts.pedantic) { if (copts.pedantic) {
if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_4) { if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UCHAR) {
if (!CInt64_IsInURange(v, 1)) if (!CInt64_IsInURange(v, 1))
PPCError_Warning(113, type, 0); PPCError_Warning(113, type, 0);
} else { } else {
@ -2079,10 +2079,10 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
} }
break; break;
case STRUCT_TYPE_7: case STRUCT_VECTOR_USHORT:
case STRUCT_TYPE_8: case STRUCT_VECTOR_SSHORT:
case STRUCT_TYPE_9: case STRUCT_VECTOR_BSHORT:
case STRUCT_TYPE_E: case STRUCT_VECTOR_PIXEL:
if (i < 7) { if (i < 7) {
PPCError_Error(110, type, 0); PPCError_Error(110, type, 0);
} else if (i > 7) { } else if (i > 7) {
@ -2099,7 +2099,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
} }
if (copts.pedantic) { if (copts.pedantic) {
if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_7 || TYPE_STRUCT(type)->stype == STRUCT_TYPE_E) { if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_USHORT || TYPE_STRUCT(type)->stype == STRUCT_VECTOR_PIXEL) {
if (!CInt64_IsInURange(v, 2)) if (!CInt64_IsInURange(v, 2))
PPCError_Warning(113, type, 0); PPCError_Warning(113, type, 0);
} else { } else {
@ -2115,7 +2115,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
if (ENODE_IS(escan, EINTCONST)) { if (ENODE_IS(escan, EINTCONST)) {
CInt64 v = escan->data.intval; CInt64 v = escan->data.intval;
if (copts.pedantic) { if (copts.pedantic) {
if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_7 || TYPE_STRUCT(type)->stype == STRUCT_TYPE_E) { if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_USHORT || TYPE_STRUCT(type)->stype == STRUCT_VECTOR_PIXEL) {
if (!CInt64_IsInURange(v, 2)) if (!CInt64_IsInURange(v, 2))
PPCError_Warning(113, type, 0); PPCError_Warning(113, type, 0);
} else { } else {
@ -2132,9 +2132,9 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
} }
break; break;
case STRUCT_TYPE_A: case STRUCT_VECTOR_UINT:
case STRUCT_TYPE_B: case STRUCT_VECTOR_SINT:
case STRUCT_TYPE_C: case STRUCT_VECTOR_BINT:
if (i < 3) { if (i < 3) {
PPCError_Error(110, type, 0); PPCError_Error(110, type, 0);
} else if (i > 3) { } else if (i > 3) {
@ -2152,7 +2152,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
} }
if (copts.pedantic) { if (copts.pedantic) {
if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_A) { if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UINT) {
if (!CInt64_IsInURange(v, 4)) if (!CInt64_IsInURange(v, 4))
PPCError_Warning(113, type, 0); PPCError_Warning(113, type, 0);
} else { } else {
@ -2168,7 +2168,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
if (ENODE_IS(escan, EINTCONST)) { if (ENODE_IS(escan, EINTCONST)) {
CInt64 v = escan->data.intval; CInt64 v = escan->data.intval;
if (copts.pedantic) { if (copts.pedantic) {
if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_A) { if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UINT) {
if (!CInt64_IsInURange(v, 4)) if (!CInt64_IsInURange(v, 4))
PPCError_Warning(113, type, 0); PPCError_Warning(113, type, 0);
} else { } else {
@ -2185,7 +2185,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
} }
break; break;
case STRUCT_TYPE_D: case STRUCT_VECTOR_FLOAT:
if (i < 3) { if (i < 3) {
PPCError_Error(110, type, 0); PPCError_Error(110, type, 0);
} else if (i > 3) { } else if (i > 3) {
@ -2228,13 +2228,13 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
} else if (ENODE_IS(expr, EINTCONST)) { } else if (ENODE_IS(expr, EINTCONST)) {
int i = 0; int i = 0;
switch (TYPE_STRUCT(type)->stype) { switch (TYPE_STRUCT(type)->stype) {
case STRUCT_TYPE_4: case STRUCT_VECTOR_UCHAR:
case STRUCT_TYPE_5: case STRUCT_VECTOR_SCHAR:
case STRUCT_TYPE_6: case STRUCT_VECTOR_BCHAR:
{ {
CInt64 v = expr->data.intval; CInt64 v = expr->data.intval;
if (copts.pedantic) { if (copts.pedantic) {
if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_4) { if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UCHAR) {
if (!CInt64_IsInURange(v, 1)) if (!CInt64_IsInURange(v, 1))
PPCError_Warning(113, type, 0); PPCError_Warning(113, type, 0);
} else { } else {
@ -2247,14 +2247,14 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
result = 1; result = 1;
break; break;
} }
case STRUCT_TYPE_7: case STRUCT_VECTOR_USHORT:
case STRUCT_TYPE_8: case STRUCT_VECTOR_SSHORT:
case STRUCT_TYPE_9: case STRUCT_VECTOR_BSHORT:
case STRUCT_TYPE_E: case STRUCT_VECTOR_PIXEL:
{ {
CInt64 v = expr->data.intval; CInt64 v = expr->data.intval;
if (copts.pedantic) { if (copts.pedantic) {
if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_7 || TYPE_STRUCT(type)->stype == STRUCT_TYPE_E) { if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_USHORT || TYPE_STRUCT(type)->stype == STRUCT_VECTOR_PIXEL) {
if (!CInt64_IsInURange(v, 2)) if (!CInt64_IsInURange(v, 2))
PPCError_Warning(113, type, 0); PPCError_Warning(113, type, 0);
} else { } else {
@ -2267,13 +2267,13 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
result = 1; result = 1;
break; break;
} }
case STRUCT_TYPE_A: case STRUCT_VECTOR_UINT:
case STRUCT_TYPE_B: case STRUCT_VECTOR_SINT:
case STRUCT_TYPE_C: case STRUCT_VECTOR_BINT:
{ {
CInt64 v = expr->data.intval; CInt64 v = expr->data.intval;
if (copts.pedantic) { if (copts.pedantic) {
if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_A) { if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UINT) {
if (!CInt64_IsInURange(v, 4)) if (!CInt64_IsInURange(v, 4))
PPCError_Warning(113, type, 0); PPCError_Warning(113, type, 0);
} else { } else {
@ -2286,7 +2286,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
result = 1; result = 1;
break; break;
} }
case STRUCT_TYPE_D: case STRUCT_VECTOR_FLOAT:
{ {
Float fv; Float fv;
if (!CInt64_IsInRange(expr->data.intval, 4)) { if (!CInt64_IsInRange(expr->data.intval, 4)) {
@ -2307,7 +2307,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
default: default:
PPCError_Error(112); PPCError_Error(112);
break; break;
case STRUCT_TYPE_D: case STRUCT_VECTOR_FLOAT:
{ {
Float fv; Float fv;
i = 0; i = 0;

View File

@ -711,17 +711,17 @@ static int StabTypeID(Type *type) {
case TYPESTRUCT: case TYPESTRUCT:
if (IS_TYPESTRUCT_VECTOR(TYPE_STRUCT(type))) { if (IS_TYPESTRUCT_VECTOR(TYPE_STRUCT(type))) {
switch (TYPE_STRUCT(type)->stype) { switch (TYPE_STRUCT(type)->stype) {
case STRUCT_TYPE_4: return StabType_VectorUChar; case STRUCT_VECTOR_UCHAR: return StabType_VectorUChar;
case STRUCT_TYPE_5: return StabType_VectorSChar; case STRUCT_VECTOR_SCHAR: return StabType_VectorSChar;
case STRUCT_TYPE_6: return StabType_VectorBChar; case STRUCT_VECTOR_BCHAR: return StabType_VectorBChar;
case STRUCT_TYPE_7: return StabType_VectorUShort; case STRUCT_VECTOR_USHORT: return StabType_VectorUShort;
case STRUCT_TYPE_8: return StabType_VectorSShort; case STRUCT_VECTOR_SSHORT: return StabType_VectorSShort;
case STRUCT_TYPE_9: return StabType_VectorBShort; case STRUCT_VECTOR_BSHORT: return StabType_VectorBShort;
case STRUCT_TYPE_A: return StabType_VectorUInt; case STRUCT_VECTOR_UINT: return StabType_VectorUInt;
case STRUCT_TYPE_B: return StabType_VectorSInt; case STRUCT_VECTOR_SINT: return StabType_VectorSInt;
case STRUCT_TYPE_C: return StabType_VectorBInt; case STRUCT_VECTOR_BINT: return StabType_VectorBInt;
case STRUCT_TYPE_D: return StabType_VectorFloat; case STRUCT_VECTOR_FLOAT: return StabType_VectorFloat;
case STRUCT_TYPE_E: return StabType_VectorPixel; case STRUCT_VECTOR_PIXEL: return StabType_VectorPixel;
} }
} else { } else {
id = local_struct(type); id = local_struct(type);

View File

@ -576,37 +576,37 @@ void IRO_SpellType(Type *type, char *buf) {
case TYPESTRUCT: case TYPESTRUCT:
if (IS_TYPESTRUCT_VECTOR(TYPE_STRUCT(type))) { if (IS_TYPESTRUCT_VECTOR(TYPE_STRUCT(type))) {
switch (TYPE_STRUCT(type)->stype) { switch (TYPE_STRUCT(type)->stype) {
case STRUCT_TYPE_4: case STRUCT_VECTOR_UCHAR:
strcpy(buf, "vector unsigned char "); strcpy(buf, "vector unsigned char ");
break; break;
case STRUCT_TYPE_5: case STRUCT_VECTOR_SCHAR:
strcpy(buf, "vector signed char "); strcpy(buf, "vector signed char ");
break; break;
case STRUCT_TYPE_6: case STRUCT_VECTOR_BCHAR:
strcpy(buf, "vector bool char "); strcpy(buf, "vector bool char ");
break; break;
case STRUCT_TYPE_7: case STRUCT_VECTOR_USHORT:
strcpy(buf, "vector unsigned short "); strcpy(buf, "vector unsigned short ");
break; break;
case STRUCT_TYPE_8: case STRUCT_VECTOR_SSHORT:
strcpy(buf, "vector signed short "); strcpy(buf, "vector signed short ");
break; break;
case STRUCT_TYPE_9: case STRUCT_VECTOR_BSHORT:
strcpy(buf, "vector bool short "); strcpy(buf, "vector bool short ");
break; break;
case STRUCT_TYPE_A: case STRUCT_VECTOR_UINT:
strcpy(buf, "vector unsigned long "); strcpy(buf, "vector unsigned long ");
break; break;
case STRUCT_TYPE_B: case STRUCT_VECTOR_SINT:
strcpy(buf, "vector signed long "); strcpy(buf, "vector signed long ");
break; break;
case STRUCT_TYPE_C: case STRUCT_VECTOR_BINT:
strcpy(buf, "vector bool long "); strcpy(buf, "vector bool long ");
break; break;
case STRUCT_TYPE_D: case STRUCT_VECTOR_FLOAT:
strcpy(buf, "vector float "); strcpy(buf, "vector float ");
break; break;
case STRUCT_TYPE_E: case STRUCT_VECTOR_PIXEL:
strcpy(buf, "vector pixel "); strcpy(buf, "vector pixel ");
break; break;
} }

View File

@ -2308,9 +2308,9 @@ CW_INLINE void PointsToFunction_RemoveByLocationSet(PointsToFunction *pointsToFu
PointsToFunction *prev; PointsToFunction *prev;
PointsToFunction *tmp; PointsToFunction *tmp;
IRO_ASSERT(3170, pointsToFunc != NULL); IRO_ASSERT(3818, pointsToFunc != NULL);
IRO_ASSERT(3171, ls != NULL); IRO_ASSERT(3819, ls != NULL);
IRO_ASSERT(3172, !LocationSet_IsUnknown(ls)); IRO_ASSERT(3820, !LocationSet_IsUnknown(ls));
prev = NULL; prev = NULL;
while (pointsToFunc && pointsToFunc->pte) { while (pointsToFunc && pointsToFunc->pte) {

View File

@ -632,21 +632,21 @@ void Coerce_to_v_register(Operand *op, Type *type, short output_reg) {
case OpndType_Absolute: case OpndType_Absolute:
reg = output_reg ? output_reg : used_virtual_registers[RegClass_VR]++; reg = output_reg ? output_reg : used_virtual_registers[RegClass_VR]++;
switch (TYPE_STRUCT(type)->stype) { switch (TYPE_STRUCT(type)->stype) {
case STRUCT_TYPE_4: case STRUCT_VECTOR_UCHAR:
case STRUCT_TYPE_5: case STRUCT_VECTOR_SCHAR:
case STRUCT_TYPE_6: case STRUCT_VECTOR_BCHAR:
emitpcode(PC_VSPLTISB, reg, op->immediate); emitpcode(PC_VSPLTISB, reg, op->immediate);
break; break;
case STRUCT_TYPE_7: case STRUCT_VECTOR_USHORT:
case STRUCT_TYPE_8: case STRUCT_VECTOR_SSHORT:
case STRUCT_TYPE_9: case STRUCT_VECTOR_BSHORT:
case STRUCT_TYPE_E: case STRUCT_VECTOR_PIXEL:
emitpcode(PC_VSPLTISH, reg, op->immediate); emitpcode(PC_VSPLTISH, reg, op->immediate);
break; break;
case STRUCT_TYPE_A: case STRUCT_VECTOR_UINT:
case STRUCT_TYPE_B: case STRUCT_VECTOR_SINT:
case STRUCT_TYPE_C: case STRUCT_VECTOR_BINT:
case STRUCT_TYPE_D: case STRUCT_VECTOR_FLOAT:
emitpcode(PC_VSPLTISW, reg, op->immediate); emitpcode(PC_VSPLTISW, reg, op->immediate);
break; break;
default: default:

View File

@ -194,7 +194,7 @@ void assign_register_by_type(Object *obj) {
vi->rclass = RegClass_GPR; vi->rclass = RegClass_GPR;
} else if (ty->type == TYPEFLOAT) { } else if (ty->type == TYPEFLOAT) {
vi->rclass = RegClass_FPR; vi->rclass = RegClass_FPR;
} else if ((ty->type == TYPESTRUCT) && (TYPE_STRUCT(ty)->stype >= STRUCT_TYPE_4) && (TYPE_STRUCT(ty)->stype <= STRUCT_TYPE_E)) { } else if ((ty->type == TYPESTRUCT) && (TYPE_STRUCT(ty)->stype >= STRUCT_VECTOR_UCHAR) && (TYPE_STRUCT(ty)->stype <= STRUCT_VECTOR_PIXEL)) {
vi->rclass = RegClass_VR; vi->rclass = RegClass_VR;
} else { } else {
return; return;

View File

@ -521,37 +521,37 @@ static void spell(Type *type, char *buf) {
case TYPESTRUCT: case TYPESTRUCT:
if (IS_TYPESTRUCT_VECTOR(TYPE_STRUCT(type))) { if (IS_TYPESTRUCT_VECTOR(TYPE_STRUCT(type))) {
switch (TYPE_STRUCT(type)->stype) { switch (TYPE_STRUCT(type)->stype) {
case STRUCT_TYPE_4: case STRUCT_VECTOR_UCHAR:
strcpy(buf, "vector unsigned char "); strcpy(buf, "vector unsigned char ");
break; break;
case STRUCT_TYPE_5: case STRUCT_VECTOR_SCHAR:
strcpy(buf, "vector signed char "); strcpy(buf, "vector signed char ");
break; break;
case STRUCT_TYPE_6: case STRUCT_VECTOR_BCHAR:
strcpy(buf, "vector bool char "); strcpy(buf, "vector bool char ");
break; break;
case STRUCT_TYPE_7: case STRUCT_VECTOR_USHORT:
strcpy(buf, "vector unsigned short "); strcpy(buf, "vector unsigned short ");
break; break;
case STRUCT_TYPE_8: case STRUCT_VECTOR_SSHORT:
strcpy(buf, "vector signed short "); strcpy(buf, "vector signed short ");
break; break;
case STRUCT_TYPE_9: case STRUCT_VECTOR_BSHORT:
strcpy(buf, "vector bool short "); strcpy(buf, "vector bool short ");
break; break;
case STRUCT_TYPE_A: case STRUCT_VECTOR_UINT:
strcpy(buf, "vector unsigned int "); strcpy(buf, "vector unsigned int ");
break; break;
case STRUCT_TYPE_B: case STRUCT_VECTOR_SINT:
strcpy(buf, "vector signed int "); strcpy(buf, "vector signed int ");
break; break;
case STRUCT_TYPE_C: case STRUCT_VECTOR_BINT:
strcpy(buf, "vector bool int "); strcpy(buf, "vector bool int ");
break; break;
case STRUCT_TYPE_D: case STRUCT_VECTOR_FLOAT:
strcpy(buf, "vector float "); strcpy(buf, "vector float ");
break; break;
case STRUCT_TYPE_E: case STRUCT_VECTOR_PIXEL:
strcpy(buf, "vector pixel "); strcpy(buf, "vector pixel ");
break; break;
} }

View File

@ -117,14 +117,14 @@ extern void scanenum(DeclInfo *declinfo);
extern void CDecl_ScanStructDeclarator(BigDeclInfo *bde); extern void CDecl_ScanStructDeclarator(BigDeclInfo *bde);
extern void scanstruct(DeclInfo *declinfo, short structtype); extern void scanstruct(DeclInfo *declinfo, short structtype);
extern void CDecl_ExtractClassExportFlags(DeclInfo *declinfo, UInt8 flags); extern void CDecl_ExtractClassExportFlags(DeclInfo *declinfo, UInt8 flags);
extern TypeMethod *CDecl_MakeTypeMemberFunc(TypeFunc *tfunc, TypeClass *tclass, Boolean flag); extern TypeMemberFunc *CDecl_MakeTypeMemberFunc(TypeFunc *tfunc, TypeClass *tclass, Boolean flag);
extern void CDecl_PackDeclInfo(PackedDeclInfo *packed, DeclInfo *declinfo); extern void CDecl_PackDeclInfo(PackedDeclInfo *packed, DeclInfo *declinfo);
extern void CDecl_UnpackDeclInfo(DeclInfo *declinfo, PackedDeclInfo *packed); extern void CDecl_UnpackDeclInfo(DeclInfo *declinfo, PackedDeclInfo *packed);
extern void CDecl_AddFriend(TypeClass *tclass, Object *friendfunc, TypeClass *friendclass); extern void CDecl_AddFriend(TypeClass *tclass, Object *friendfunc, TypeClass *friendclass);
extern void CDecl_CheckCtorIntegrity(FuncArg *args, TypeClass *tclass); extern void CDecl_CheckCtorIntegrity(FuncArg *args, TypeClass *tclass);
extern void CDecl_MakeVBaseList(TypeClass *tclass); extern void CDecl_MakeVBaseList(TypeClass *tclass);
extern Boolean CDecl_CheckNewBase(TypeClass *tclass, TypeClass *baseclass, Boolean is_virtual); extern Boolean CDecl_CheckNewBase(TypeClass *tclass, TypeClass *baseclass, Boolean is_virtual);
extern TypeMethod *CDecl_MakeDefaultDtorType(TypeClass *tclass, Boolean is_virtual); extern TypeMemberFunc *CDecl_MakeDefaultDtorType(TypeClass *tclass, Boolean is_virtual);
extern void CDecl_CompleteClass(DeclE *decle, TypeClass *tclass); extern void CDecl_CompleteClass(DeclE *decle, TypeClass *tclass);
extern TypeClass *CDecl_DefineClass(NameSpace *nspace, HashNameNode *name, TypeClass *tclass, short mode, Boolean flag2, Boolean flag3); extern TypeClass *CDecl_DefineClass(NameSpace *nspace, HashNameNode *name, TypeClass *tclass, short mode, Boolean flag2, Boolean flag3);
extern void CDecl_ParseClassDeclSpec(UInt8 *declspec); extern void CDecl_ParseClassDeclSpec(UInt8 *declspec);

View File

@ -198,7 +198,7 @@ typedef struct TypeFunc TypeFunc;
typedef struct TypeIntegral TypeIntegral; typedef struct TypeIntegral TypeIntegral;
typedef struct TypeList TypeList; typedef struct TypeList TypeList;
typedef struct TypeMemberPointer TypeMemberPointer; typedef struct TypeMemberPointer TypeMemberPointer;
typedef struct TypeMethod TypeMethod; typedef struct TypeMemberFunc TypeMemberFunc;
typedef struct TypeObjCID TypeObjCID; typedef struct TypeObjCID TypeObjCID;
typedef struct TypePointer TypePointer; typedef struct TypePointer TypePointer;
typedef struct TypeStruct TypeStruct; typedef struct TypeStruct TypeStruct;

View File

@ -100,34 +100,19 @@ enum {
STRUCT_TYPE_STRUCT = 0, STRUCT_TYPE_STRUCT = 0,
STRUCT_TYPE_UNION = 1, STRUCT_TYPE_UNION = 1,
STRUCT_TYPE_CLASS = 2, STRUCT_TYPE_CLASS = 2,
STRUCT_TYPE_3 = 3, STRUCT_TYPE_MAX = 3,
STRUCT_TYPE_4 = 4, STRUCT_VECTOR_UCHAR = 4,
STRUCT_TYPE_5 = 5, STRUCT_VECTOR_SCHAR = 5,
STRUCT_TYPE_6 = 6, STRUCT_VECTOR_BCHAR = 6,
STRUCT_TYPE_7 = 7, STRUCT_VECTOR_USHORT = 7,
STRUCT_TYPE_8 = 8, STRUCT_VECTOR_SSHORT = 8,
STRUCT_TYPE_9 = 9, STRUCT_VECTOR_BSHORT = 9,
STRUCT_TYPE_A = 10, STRUCT_VECTOR_UINT = 10,
STRUCT_TYPE_B = 11, STRUCT_VECTOR_SINT = 11,
STRUCT_TYPE_C = 12, STRUCT_VECTOR_BINT = 12,
STRUCT_TYPE_D = 13, STRUCT_VECTOR_FLOAT = 13,
STRUCT_TYPE_E = 14 STRUCT_VECTOR_PIXEL = 14
}; };
//const char STRUCT_TYPE_STRUCT = 0;
//const char STRUCT_TYPE_UNION = 1;
//const char STRUCT_TYPE_CLASS = 2;
//const char STRUCT_TYPE_3 = 3;
//const char STRUCT_TYPE_4 = 4;
//const char STRUCT_TYPE_5 = 5;
//const char STRUCT_TYPE_6 = 6;
//const char STRUCT_TYPE_7 = 7;
//const char STRUCT_TYPE_8 = 8;
//const char STRUCT_TYPE_9 = 9;
//const char STRUCT_TYPE_A = 10;
//const char STRUCT_TYPE_B = 11;
//const char STRUCT_TYPE_C = 12;
//const char STRUCT_TYPE_D = 13;
//const char STRUCT_TYPE_E = 14;
struct ClassList { // checked via CPrec struct ClassList { // checked via CPrec
@ -283,7 +268,7 @@ enum {
// This is actually called TypeMemberFunc... // This is actually called TypeMemberFunc...
// There seems to be a version of this which adds a class pointer at the end // There seems to be a version of this which adds a class pointer at the end
struct TypeMethod { struct TypeMemberFunc {
TypeType type; TypeType type;
SInt32 size; SInt32 size;
FuncArg *args; FuncArg *args;
@ -398,7 +383,7 @@ struct TypeList {
#define TYPE_STRUCT(ty) ((TypeStruct *) (ty)) #define TYPE_STRUCT(ty) ((TypeStruct *) (ty))
#define TYPE_CLASS(ty) ((TypeClass *) (ty)) #define TYPE_CLASS(ty) ((TypeClass *) (ty))
#define TYPE_FUNC(ty) ((TypeFunc *) (ty)) #define TYPE_FUNC(ty) ((TypeFunc *) (ty))
#define TYPE_METHOD(ty) ((TypeMethod *) (ty)) #define TYPE_METHOD(ty) ((TypeMemberFunc *) (ty))
#define TYPE_BITFIELD(ty) ((TypeBitfield *) (ty)) #define TYPE_BITFIELD(ty) ((TypeBitfield *) (ty))
#define TYPE_TEMPLATE(ty) ((TypeTemplDep *) (ty)) #define TYPE_TEMPLATE(ty) ((TypeTemplDep *) (ty))
#define TYPE_MEMBER_POINTER(ty) ((TypeMemberPointer *) (ty)) #define TYPE_MEMBER_POINTER(ty) ((TypeMemberPointer *) (ty))
@ -433,7 +418,7 @@ struct TypeList {
#define IS_TYPE_ARRAY(ty) ( (ty)->type == TYPEARRAY ) #define IS_TYPE_ARRAY(ty) ( (ty)->type == TYPEARRAY )
#define IS_TYPE_BITFIELD(ty) ( (ty)->type == TYPEBITFIELD ) #define IS_TYPE_BITFIELD(ty) ( (ty)->type == TYPEBITFIELD )
#define IS_TYPE_TEMPLDEPEXPR(ty) ( (ty)->type == TYPETEMPLDEPEXPR ) #define IS_TYPE_TEMPLDEPEXPR(ty) ( (ty)->type == TYPETEMPLDEPEXPR )
#define IS_TYPESTRUCT_VECTOR(ty) ( (ty)->stype >= STRUCT_TYPE_4 && (ty)->stype <= STRUCT_TYPE_E ) #define IS_TYPESTRUCT_VECTOR(ty) ( (ty)->stype >= STRUCT_VECTOR_UCHAR && (ty)->stype <= STRUCT_VECTOR_PIXEL )
#define IS_TYPE_VECTOR(ty) ( (ty)->type == TYPESTRUCT && IS_TYPESTRUCT_VECTOR(TYPE_STRUCT(ty)) ) #define IS_TYPE_VECTOR(ty) ( (ty)->type == TYPESTRUCT && IS_TYPESTRUCT_VECTOR(TYPE_STRUCT(ty)) )
#define IS_TYPE_NONVECTOR_STRUCT(ty) ( (ty)->type == TYPESTRUCT && !IS_TYPESTRUCT_VECTOR(TYPE_STRUCT(ty)) ) #define IS_TYPE_NONVECTOR_STRUCT(ty) ( (ty)->type == TYPESTRUCT && !IS_TYPESTRUCT_VECTOR(TYPE_STRUCT(ty)) )
#define IS_TYPE_MEMBERPOINTER(ty) ( (ty)->type == TYPEMEMBERPOINTER ) #define IS_TYPE_MEMBERPOINTER(ty) ( (ty)->type == TYPEMEMBERPOINTER )