Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 1 | //===- subzero/src/IceTypes.def - X-macros for ICE types --------*- C++ -*-===// |
| 2 | // |
| 3 | // The Subzero Code Generator |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
Andrew Scull | 57e1268 | 2015-09-16 11:30:19 -0700 | [diff] [blame] | 10 | // This file defines properties of ICE primitive types in the form of x-macros. |
Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef SUBZERO_SRC_ICETYPES_DEF |
| 15 | #define SUBZERO_SRC_ICETYPES_DEF |
| 16 | |
Jan Voung | 08c3bcd | 2014-12-01 17:55:16 -0800 | [diff] [blame] | 17 | // Attributes of each target architecture. |
Andrew Scull | 57e1268 | 2015-09-16 11:30:19 -0700 | [diff] [blame] | 18 | // NOTE on is_elf64 -- At some point NaCl would like to use ELF32 for all ILP32 |
| 19 | // sandboxes, but for now the 64-bit architectures use ELF64: |
| 20 | // https://code.google.com/p/nativeclient/issues/detail?id=349 TODO: Whoever |
| 21 | // adds AArch64 will need to set ABI e_flags. |
Karl Schimpf | ff94f59 | 2015-09-18 10:37:44 -0700 | [diff] [blame] | 22 | #define TARGETARCH_TABLE \ |
| 23 | /* enum value, printable string, is_elf64, e_machine, e_flags */ \ |
| 24 | X(Target_X8632, "x86-32", false, EM_386, 0) \ |
| 25 | X(Target_X8664, "x86-64", true, EM_X86_64, 0) \ |
| 26 | X(Target_ARM32, "arm32", false, EM_ARM, EF_ARM_EABI_VER5) \ |
| 27 | X(Target_ARM64, "arm64", true, EM_AARCH64, 0) \ |
| 28 | X(Target_MIPS32,"mips32", false, EM_MIPS, 0) \ |
| 29 | //#define X(tag, str, is_elf64, e_machine, e_flags) |
Karl Schimpf | b262c5e | 2014-10-27 14:41:57 -0700 | [diff] [blame] | 30 | |
Karl Schimpf | ff94f59 | 2015-09-18 10:37:44 -0700 | [diff] [blame] | 31 | #define ICETYPE_TABLE \ |
Jim Stichnoth | c59288b | 2015-11-09 11:38:40 -0800 | [diff] [blame^] | 32 | /* enum value, log_2(size), align, # elts, element type, */ \ |
| 33 | /* printable string (size and alignment in bytes) */ \ |
| 34 | X(void, -1, 0, 1, void, "void") \ |
| 35 | X(i1, 0, 1, 1, i1, "i1") \ |
| 36 | X(i8, 0, 1, 1, i8, "i8") \ |
| 37 | X(i16, 1, 1, 1, i16, "i16") \ |
| 38 | X(i32, 2, 1, 1, i32, "i32") \ |
| 39 | X(i64, 3, 1, 1, i64, "i64") \ |
| 40 | X(f32, 2, 4, 1, f32, "float") \ |
| 41 | X(f64, 3, 8, 1, f64, "double") \ |
| 42 | X(v4i1, 4, 1, 4, i1, "<4 x i1>") \ |
| 43 | X(v8i1, 4, 1, 8, i1, "<8 x i1>") \ |
| 44 | X(v16i1, 4, 1, 16, i1, "<16 x i1>") \ |
| 45 | X(v16i8, 4, 1, 16, i8, "<16 x i8>") \ |
| 46 | X(v8i16, 4, 2, 8, i16, "<8 x i16>") \ |
| 47 | X(v4i32, 4, 4, 4, i32, "<4 x i32>") \ |
| 48 | X(v4f32, 4, 4, 4, f32, "<4 x float>") \ |
Andrew Scull | 87f80c1 | 2015-07-20 10:19:16 -0700 | [diff] [blame] | 49 | //#define X(tag, sizeLog2, align, elts, elty, str) |
Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 50 | |
Karl Schimpf | d6064a1 | 2014-08-27 15:34:58 -0700 | [diff] [blame] | 51 | // Dictionary: |
| 52 | // V - Is vector type. |
| 53 | // I - Is integer value (scalar or vector). |
| 54 | // F - Is floating point value (scalar or vector). |
| 55 | // IA - Is integer arithmetic type |
Karl Schimpf | 41689df | 2014-09-10 14:36:07 -0700 | [diff] [blame] | 56 | // LS - true if load/store allowed on type. |
Karl Schimpf | ff94f59 | 2015-09-18 10:37:44 -0700 | [diff] [blame] | 57 | // P - true if can be used for parameter of call. |
Karl Schimpf | 83f9f0c | 2014-09-05 08:30:55 -0700 | [diff] [blame] | 58 | // CR - Result type of compare instruction for argument type |
| 59 | // (IceType_void if disallowed) |
Karl Schimpf | ff94f59 | 2015-09-18 10:37:44 -0700 | [diff] [blame] | 60 | #define ICETYPE_PROPS_TABLE \ |
Jim Stichnoth | c59288b | 2015-11-09 11:38:40 -0800 | [diff] [blame^] | 61 | /* Enum Value V I F IA LS P CR */ \ |
| 62 | X(void, 0, 0, 0, 0, 0, 0, void) \ |
| 63 | X(i1, 0, 1, 0, 0, 0, 0, i1) \ |
| 64 | X(i8, 0, 1, 0, 1, 1, 0, i1) \ |
| 65 | X(i16, 0, 1, 0, 1, 1, 0, i1) \ |
| 66 | X(i32, 0, 1, 0, 1, 1, 1, i1) \ |
| 67 | X(i64, 0, 1, 0, 1, 1, 1, i1) \ |
| 68 | X(f32, 0, 0, 1, 0, 1, 1, i1) \ |
| 69 | X(f64, 0, 0, 1, 0, 1, 1, i1) \ |
| 70 | X(v4i1, 1, 1, 0, 0, 0, 1, v4i1) \ |
| 71 | X(v8i1, 1, 1, 0, 0, 0, 1, v8i1) \ |
| 72 | X(v16i1, 1, 1, 0, 0, 0, 1, v16i1) \ |
| 73 | X(v16i8, 1, 1, 0, 1, 1, 1, v16i1) \ |
| 74 | X(v8i16, 1, 1, 0, 1, 1, 1, v8i1) \ |
| 75 | X(v4i32, 1, 1, 0, 1, 1, 1, v4i1) \ |
| 76 | X(v4f32, 1, 0, 1, 0, 1, 1, v4i1) \ |
Karl Schimpf | ff94f59 | 2015-09-18 10:37:44 -0700 | [diff] [blame] | 77 | //#define X(tag, IsVec, IsInt, IsFloat, IsIntArith, IsLoadStore, IsParam, \ |
| 78 | // CompareResult) |
Karl Schimpf | d6064a1 | 2014-08-27 15:34:58 -0700 | [diff] [blame] | 79 | |
Jim Stichnoth | f7c9a14 | 2014-04-29 10:52:43 -0700 | [diff] [blame] | 80 | #endif // SUBZERO_SRC_ICETYPES_DEF |