OLD | NEW |
1 //===- subzero/src/IceTypes.def - X-macros for ICE types --------*- C++ -*-===// | 1 //===- subzero/src/IceTypes.def - X-macros for ICE types --------*- C++ -*-===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file defines properties of ICE primitive types in the form of x-macros. | 10 // This file defines properties of ICE primitive types in the form of x-macros. |
11 // | 11 // |
12 //===----------------------------------------------------------------------===// | 12 //===----------------------------------------------------------------------===// |
13 | 13 |
14 #ifndef SUBZERO_SRC_ICETYPES_DEF | 14 #ifndef SUBZERO_SRC_ICETYPES_DEF |
15 #define SUBZERO_SRC_ICETYPES_DEF | 15 #define SUBZERO_SRC_ICETYPES_DEF |
16 | 16 |
17 // Attributes of each target architecture. | 17 // Attributes of each target architecture. |
18 // NOTES on is_elf64: | 18 // NOTES on is_elf64: |
19 // 1- At some point NaCl would like to use ELF32 for all ILP32 sandboxes, but | 19 // 1- At some point NaCl would like to use ELF32 for all ILP32 sandboxes, but |
20 // for now the 64-bit architectures use ELF64: | 20 // for now the 64-bit architectures use ELF64: |
21 // https://code.google.com/p/nativeclient/issues/detail?id=349 | 21 // https://code.google.com/p/nativeclient/issues/detail?id=349 |
22 // | 22 // |
23 // 2- native code is always emitted as ELF32. | 23 // 2- native code is always emitted as ELF32. |
24 // | 24 // |
25 // TODO(jpp): set ABI e_flags for AArch64. | 25 // TODO(jpp): set ABI e_flags for AArch64. |
26 #define TARGETARCH_TABLE \ | 26 #define TARGETARCH_TABLE \ |
27 /* enum value, printable string, is_elf64, e_machine, e_flags */ \ | 27 /* enum value, printable string, is_elf64, e_machine, e_flags */ \ |
28 X(Target_X8632, "x86-32", false, EM_386, 0) \ | 28 X(Target_X8632, "x86-32", false, EM_386, 0) \ |
29 X(Target_X8664, "x86-64", true, EM_X86_64, 0)
\ | 29 X(Target_X8664, "x86-64", true, EM_X86_64, 0) \ |
30 X(Target_ARM32, "arm32", false, EM_ARM, EF_ARM_EABI_VER5) \ | 30 X(Target_ARM32, "arm32", false, EM_ARM, EF_ARM_EABI_VER5) \ |
31 X(Target_ARM64, "arm64", true, EM_AARCH64, 0) \ | 31 X(Target_ARM64, "arm64", true, EM_AARCH64, 0) \ |
32 X(Target_MIPS32,"mips32", false, EM_MIPS, 0) \ | 32 X(Target_MIPS32,"mips32", false, EM_MIPS, 0) \ |
33 //#define X(tag, str, is_elf64, e_machine, e_flags) | 33 //#define X(tag, str, is_elf64, e_machine, e_flags) |
34 | 34 |
35 #define ICETYPE_TABLE \ | 35 #define ICETYPE_TABLE \ |
36 /* enum value, log_2(size), align, # elts, element type, */ \ | 36 /* enum value, log_2(size), align, # elts, element type, */ \ |
37 /* printable string (size and alignment in bytes) */ \ | 37 /* printable string (size and alignment in bytes), */ \ |
38 X(void, -1, 0, 1, void, "void") \ | 38 /* register class string */ \ |
39 X(i1, 0, 1, 1, i1, "i1") \ | 39 X(void, -1, 0, 1, void, "void", "void") \ |
40 X(i8, 0, 1, 1, i8, "i8") \ | 40 X(i1, 0, 1, 1, i1, "i1", "i1") \ |
41 X(i16, 1, 1, 1, i16, "i16") \ | 41 X(i8, 0, 1, 1, i8, "i8", "i8") \ |
42 X(i32, 2, 1, 1, i32, "i32") \ | 42 X(i16, 1, 1, 1, i16, "i16", "i16") \ |
43 X(i64, 3, 1, 1, i64, "i64") \ | 43 X(i32, 2, 1, 1, i32, "i32", "i32") \ |
44 X(f32, 2, 4, 1, f32, "float") \ | 44 X(i64, 3, 1, 1, i64, "i64", "i64") \ |
45 X(f64, 3, 8, 1, f64, "double") \ | 45 X(f32, 2, 4, 1, f32, "float", "f32") \ |
46 X(v4i1, 4, 1, 4, i1, "<4 x i1>") \ | 46 X(f64, 3, 8, 1, f64, "double", "f64") \ |
47 X(v8i1, 4, 1, 8, i1, "<8 x i1>") \ | 47 X(v4i1, 4, 1, 4, i1, "<4 x i1>", "v4i1") \ |
48 X(v16i1, 4, 1, 16, i1, "<16 x i1>") \ | 48 X(v8i1, 4, 1, 8, i1, "<8 x i1>", "v8ii") \ |
49 X(v16i8, 4, 1, 16, i8, "<16 x i8>") \ | 49 X(v16i1, 4, 1, 16, i1, "<16 x i1>", "v16i1") \ |
50 X(v8i16, 4, 2, 8, i16, "<8 x i16>") \ | 50 X(v16i8, 4, 1, 16, i8, "<16 x i8>", "v16i8") \ |
51 X(v4i32, 4, 4, 4, i32, "<4 x i32>") \ | 51 X(v8i16, 4, 2, 8, i16, "<8 x i16>", "v8i16") \ |
52 X(v4f32, 4, 4, 4, f32, "<4 x float>") \ | 52 X(v4i32, 4, 4, 4, i32, "<4 x i32>", "v4i32") \ |
53 //#define X(tag, sizeLog2, align, elts, elty, str) | 53 X(v4f32, 4, 4, 4, f32, "<4 x float>", "v4f32") \ |
| 54 //#define X(tag, sizeLog2, align, elts, elty, str, rcstr) |
54 | 55 |
55 // Dictionary: | 56 // Dictionary: |
56 // V - Is vector type. | 57 // V - Is vector type. |
57 // I - Is integer value (scalar or vector). | 58 // I - Is integer value (scalar or vector). |
58 // F - Is floating point value (scalar or vector). | 59 // F - Is floating point value (scalar or vector). |
59 // IA - Is integer arithmetic type | 60 // IA - Is integer arithmetic type |
60 // LS - true if load/store allowed on type. | 61 // LS - true if load/store allowed on type. |
61 // P - true if can be used for parameter of call. | 62 // P - true if can be used for parameter of call. |
62 // CR - Result type of compare instruction for argument type | 63 // CR - Result type of compare instruction for argument type |
63 // (IceType_void if disallowed) | 64 // (IceType_void if disallowed) |
(...skipping 11 matching lines...) Expand all Loading... |
75 X(v8i1, 1, 1, 0, 0, 0, 1, v8i1) \ | 76 X(v8i1, 1, 1, 0, 0, 0, 1, v8i1) \ |
76 X(v16i1, 1, 1, 0, 0, 0, 1, v16i1) \ | 77 X(v16i1, 1, 1, 0, 0, 0, 1, v16i1) \ |
77 X(v16i8, 1, 1, 0, 1, 1, 1, v16i1) \ | 78 X(v16i8, 1, 1, 0, 1, 1, 1, v16i1) \ |
78 X(v8i16, 1, 1, 0, 1, 1, 1, v8i1) \ | 79 X(v8i16, 1, 1, 0, 1, 1, 1, v8i1) \ |
79 X(v4i32, 1, 1, 0, 1, 1, 1, v4i1) \ | 80 X(v4i32, 1, 1, 0, 1, 1, 1, v4i1) \ |
80 X(v4f32, 1, 0, 1, 0, 1, 1, v4i1) \ | 81 X(v4f32, 1, 0, 1, 0, 1, 1, v4i1) \ |
81 //#define X(tag, IsVec, IsInt, IsFloat, IsIntArith, IsLoadStore, IsParam, \ | 82 //#define X(tag, IsVec, IsInt, IsFloat, IsIntArith, IsLoadStore, IsParam, \ |
82 // CompareResult) | 83 // CompareResult) |
83 | 84 |
84 #endif // SUBZERO_SRC_ICETYPES_DEF | 85 #endif // SUBZERO_SRC_ICETYPES_DEF |
OLD | NEW |