aboutsummaryrefslogtreecommitdiff
path: root/src/type.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/type.c')
-rw-r--r--src/type.c63
1 files changed, 13 insertions, 50 deletions
diff --git a/src/type.c b/src/type.c
index 8ae74de..ebd2926 100644
--- a/src/type.c
+++ b/src/type.c
@@ -1,52 +1,15 @@
#include "type.h"
-/**
- * Builtin types
- */
-
-const struct cer_int int8_b = {
- .sign = true,
- .bits = 8,
-};
-
-const struct cer_int uint8_b = {
- .sign = false,
- .bits = 8,
-};
-
-const struct cer_int int16_b = {
- .sign = true,
- .bits = 16,
-};
-
-const struct cer_int uint16_b = {
- .sign = false,
- .bits = 16,
-};
-
-const struct cer_int int32_b = {
- .sign = true,
- .bits = 32,
-};
-
-const struct cer_int uint32_b = {
- .sign = false,
- .bits = 32,
-};
-
-const struct cer_int int64_b = {
- .sign = true,
- .bits = 64,
-};
-
-const struct cer_int uint64_b = {
- .sign = false,
- .bits = 64,
-};
-
-// Only 64-bit targets are supported (by QBE)
-const struct cer_int int_b = int64_b;
-const struct cer_int uint_b = uint64_b;
-
-const struct cer_float float32_b = { .is64 = false };
-const struct cer_float float64_b = { .is64 = true };
+const struct cer_int cer_int8_t = struct cer_int { .bits = 8, .issigned = 1 };
+const struct cer_int cer_uint8_t = struct cer_int { .bits = 8, .issigned = 0 };
+const struct cer_int cer_int16_t = struct cer_int { .bits = 16, .issigned = 1 };
+const struct cer_int cer_uint16_t = struct cer_int { .bits = 16, .issigned = 0 };
+const struct cer_int cer_int32_t = struct cer_int { .bits = 32, .issigned = 1 };
+const struct cer_int cer_uint32_t = struct cer_int { .bits = 32, .issigned = 0 };
+const struct cer_int cer_int64_t = struct cer_int { .bits = 64, .issigned = 1 };
+const struct cer_int cer_uint64_t = struct cer_int { .bits = 64, .issigned = 0 };
+const struct cer_int cer_int_t = struct cer_int { .bits = PLATBITS, .issigned = 1 };
+const struct cer_int cer_uint_t = struct cer_int { .bits = PLATBITS, .issigned = 0 };
+
+const struct cer_float cer_float32_t = struct cer_float { .bits = 32 };
+const struct cer_float cer_floaf64_t = struct cer_float { .bits = 64 };