summaryrefslogtreecommitdiff
path: root/compiler_and_linker/unsorted/CodeGen.c
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-01-18 17:19:20 +0000
committerAsh Wolf <ninji@wuffs.org>2023-01-18 17:19:20 +0000
commit5d0bbb19cc133753cebda7099e46d4b2084336c6 (patch)
tree649e0b361bab4c2400fc684f7b18cf2da670525b /compiler_and_linker/unsorted/CodeGen.c
parenta231f5dbb93c60da240a027f2afd8a4797069541 (diff)
downloadMWCC-5d0bbb19cc133753cebda7099e46d4b2084336c6.tar.gz
MWCC-5d0bbb19cc133753cebda7099e46d4b2084336c6.zip
rename TypeMethod and the struct type enums
Diffstat (limited to 'compiler_and_linker/unsorted/CodeGen.c')
-rw-r--r--compiler_and_linker/unsorted/CodeGen.c86
1 files changed, 43 insertions, 43 deletions
diff --git a/compiler_and_linker/unsorted/CodeGen.c b/compiler_and_linker/unsorted/CodeGen.c
index f14aa60..19c7d1d 100644
--- a/compiler_and_linker/unsorted/CodeGen.c
+++ b/compiler_and_linker/unsorted/CodeGen.c
@@ -1969,17 +1969,17 @@ ENode *CodeGen_HandleTypeCast(ENode *expr, Type *type, UInt32 qual) {
flags = qual & ENODE_FLAG_QUALS;
if (IS_TYPE_STRUCT(type) && IS_TYPE_STRUCT(expr->rtype) && expr->flags == flags) {
switch (TYPE_STRUCT(type)->stype) {
- case STRUCT_TYPE_4:
- case STRUCT_TYPE_5:
- case STRUCT_TYPE_6:
- case STRUCT_TYPE_7:
- case STRUCT_TYPE_8:
- case STRUCT_TYPE_9:
- case STRUCT_TYPE_A:
- case STRUCT_TYPE_B:
- case STRUCT_TYPE_C:
- case STRUCT_TYPE_D:
- case STRUCT_TYPE_E:
+ case STRUCT_VECTOR_UCHAR:
+ case STRUCT_VECTOR_SCHAR:
+ case STRUCT_VECTOR_BCHAR:
+ case STRUCT_VECTOR_USHORT:
+ case STRUCT_VECTOR_SSHORT:
+ case STRUCT_VECTOR_BSHORT:
+ case STRUCT_VECTOR_UINT:
+ case STRUCT_VECTOR_SINT:
+ case STRUCT_VECTOR_BINT:
+ case STRUCT_VECTOR_FLOAT:
+ case STRUCT_VECTOR_PIXEL:
expr = makemonadicnode(expr, ETYPCON);
expr->rtype = type;
expr->flags = flags;
@@ -2026,9 +2026,9 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
escan = escan->data.diadic.left;
}
switch (TYPE_STRUCT(type)->stype) {
- case STRUCT_TYPE_4:
- case STRUCT_TYPE_5:
- case STRUCT_TYPE_6:
+ case STRUCT_VECTOR_UCHAR:
+ case STRUCT_VECTOR_SCHAR:
+ case STRUCT_VECTOR_BCHAR:
if (i < 15) {
PPCError_Error(110, type, 0);
} else if (i > 15) {
@@ -2046,7 +2046,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
}
if (copts.pedantic) {
- if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_4) {
+ if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UCHAR) {
if (!CInt64_IsInURange(v, 1))
PPCError_Warning(113, type, 0);
} else {
@@ -2062,7 +2062,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
if (ENODE_IS(escan, EINTCONST)) {
CInt64 v = escan->data.intval;
if (copts.pedantic) {
- if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_4) {
+ if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UCHAR) {
if (!CInt64_IsInURange(v, 1))
PPCError_Warning(113, type, 0);
} else {
@@ -2079,10 +2079,10 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
}
break;
- case STRUCT_TYPE_7:
- case STRUCT_TYPE_8:
- case STRUCT_TYPE_9:
- case STRUCT_TYPE_E:
+ case STRUCT_VECTOR_USHORT:
+ case STRUCT_VECTOR_SSHORT:
+ case STRUCT_VECTOR_BSHORT:
+ case STRUCT_VECTOR_PIXEL:
if (i < 7) {
PPCError_Error(110, type, 0);
} else if (i > 7) {
@@ -2099,7 +2099,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
}
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))
PPCError_Warning(113, type, 0);
} else {
@@ -2115,7 +2115,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
if (ENODE_IS(escan, EINTCONST)) {
CInt64 v = escan->data.intval;
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))
PPCError_Warning(113, type, 0);
} else {
@@ -2132,9 +2132,9 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
}
break;
- case STRUCT_TYPE_A:
- case STRUCT_TYPE_B:
- case STRUCT_TYPE_C:
+ case STRUCT_VECTOR_UINT:
+ case STRUCT_VECTOR_SINT:
+ case STRUCT_VECTOR_BINT:
if (i < 3) {
PPCError_Error(110, type, 0);
} else if (i > 3) {
@@ -2152,7 +2152,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
}
if (copts.pedantic) {
- if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_A) {
+ if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UINT) {
if (!CInt64_IsInURange(v, 4))
PPCError_Warning(113, type, 0);
} else {
@@ -2168,7 +2168,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
if (ENODE_IS(escan, EINTCONST)) {
CInt64 v = escan->data.intval;
if (copts.pedantic) {
- if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_A) {
+ if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UINT) {
if (!CInt64_IsInURange(v, 4))
PPCError_Warning(113, type, 0);
} else {
@@ -2185,7 +2185,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
}
break;
- case STRUCT_TYPE_D:
+ case STRUCT_VECTOR_FLOAT:
if (i < 3) {
PPCError_Error(110, type, 0);
} else if (i > 3) {
@@ -2228,13 +2228,13 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
} else if (ENODE_IS(expr, EINTCONST)) {
int i = 0;
switch (TYPE_STRUCT(type)->stype) {
- case STRUCT_TYPE_4:
- case STRUCT_TYPE_5:
- case STRUCT_TYPE_6:
+ case STRUCT_VECTOR_UCHAR:
+ case STRUCT_VECTOR_SCHAR:
+ case STRUCT_VECTOR_BCHAR:
{
CInt64 v = expr->data.intval;
if (copts.pedantic) {
- if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_4) {
+ if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UCHAR) {
if (!CInt64_IsInURange(v, 1))
PPCError_Warning(113, type, 0);
} else {
@@ -2247,14 +2247,14 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
result = 1;
break;
}
- case STRUCT_TYPE_7:
- case STRUCT_TYPE_8:
- case STRUCT_TYPE_9:
- case STRUCT_TYPE_E:
+ case STRUCT_VECTOR_USHORT:
+ case STRUCT_VECTOR_SSHORT:
+ case STRUCT_VECTOR_BSHORT:
+ case STRUCT_VECTOR_PIXEL:
{
CInt64 v = expr->data.intval;
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))
PPCError_Warning(113, type, 0);
} else {
@@ -2267,13 +2267,13 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
result = 1;
break;
}
- case STRUCT_TYPE_A:
- case STRUCT_TYPE_B:
- case STRUCT_TYPE_C:
+ case STRUCT_VECTOR_UINT:
+ case STRUCT_VECTOR_SINT:
+ case STRUCT_VECTOR_BINT:
{
CInt64 v = expr->data.intval;
if (copts.pedantic) {
- if (TYPE_STRUCT(type)->stype == STRUCT_TYPE_A) {
+ if (TYPE_STRUCT(type)->stype == STRUCT_VECTOR_UINT) {
if (!CInt64_IsInURange(v, 4))
PPCError_Warning(113, type, 0);
} else {
@@ -2286,7 +2286,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
result = 1;
break;
}
- case STRUCT_TYPE_D:
+ case STRUCT_VECTOR_FLOAT:
{
Float fv;
if (!CInt64_IsInRange(expr->data.intval, 4)) {
@@ -2307,7 +2307,7 @@ Boolean CodeGen_CollapseVectorExpression(ENode *expr, MWVector128 *vec, Type *ty
default:
PPCError_Error(112);
break;
- case STRUCT_TYPE_D:
+ case STRUCT_VECTOR_FLOAT:
{
Float fv;
i = 0;