blob: a1a2552a2b81fc03f76ce85e6cb2e60268d78ac4 [file] [log] [blame]
Jim Stichnothf7c9a142014-04-29 10:52:43 -07001//===- 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 Scull57e12682015-09-16 11:30:19 -070010// This file defines properties of ICE primitive types in the form of x-macros.
Jim Stichnothf7c9a142014-04-29 10:52:43 -070011//
12//===----------------------------------------------------------------------===//
13
14#ifndef SUBZERO_SRC_ICETYPES_DEF
15#define SUBZERO_SRC_ICETYPES_DEF
16
Jan Voung08c3bcd2014-12-01 17:55:16 -080017// Attributes of each target architecture.
John Porto56958cb2016-01-14 09:18:18 -080018// NOTES on is_elf64:
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:
21// https://code.google.com/p/nativeclient/issues/detail?id=349
22//
23// 2- native code is always emitted as ELF32.
24//
25// TODO(jpp): set ABI e_flags for AArch64.
Karl Schimpfff94f592015-09-18 10:37:44 -070026#define TARGETARCH_TABLE \
27 /* enum value, printable string, is_elf64, e_machine, e_flags */ \
28 X(Target_X8632, "x86-32", false, EM_386, 0) \
Jim Stichnoth2544d4d2016-01-22 13:07:46 -080029 X(Target_X8664, "x86-64", true, EM_X86_64, 0) \
Karl Schimpfff94f592015-09-18 10:37:44 -070030 X(Target_ARM32, "arm32", false, EM_ARM, EF_ARM_EABI_VER5) \
31 X(Target_ARM64, "arm64", true, EM_AARCH64, 0) \
32 X(Target_MIPS32,"mips32", false, EM_MIPS, 0) \
33//#define X(tag, str, is_elf64, e_machine, e_flags)
Karl Schimpfb262c5e2014-10-27 14:41:57 -070034
Karl Schimpfff94f592015-09-18 10:37:44 -070035#define ICETYPE_TABLE \
Jim Stichnothc59288b2015-11-09 11:38:40 -080036 /* enum value, log_2(size), align, # elts, element type, */ \
Jim Stichnoth2544d4d2016-01-22 13:07:46 -080037 /* printable string (size and alignment in bytes), */ \
38 /* register class string */ \
39 X(void, -1, 0, 1, void, "void", "void") \
40 X(i1, 0, 1, 1, i1, "i1", "i1") \
41 X(i8, 0, 1, 1, i8, "i8", "i8") \
42 X(i16, 1, 1, 1, i16, "i16", "i16") \
43 X(i32, 2, 1, 1, i32, "i32", "i32") \
44 X(i64, 3, 1, 1, i64, "i64", "i64") \
45 X(f32, 2, 4, 1, f32, "float", "f32") \
46 X(f64, 3, 8, 1, f64, "double", "f64") \
47 X(v4i1, 4, 1, 4, i1, "<4 x i1>", "v4i1") \
48 X(v8i1, 4, 1, 8, i1, "<8 x i1>", "v8ii") \
49 X(v16i1, 4, 1, 16, i1, "<16 x i1>", "v16i1") \
50 X(v16i8, 4, 1, 16, i8, "<16 x i8>", "v16i8") \
51 X(v8i16, 4, 2, 8, i16, "<8 x i16>", "v8i16") \
52 X(v4i32, 4, 4, 4, i32, "<4 x i32>", "v4i32") \
53 X(v4f32, 4, 4, 4, f32, "<4 x float>", "v4f32") \
54//#define X(tag, sizeLog2, align, elts, elty, str, rcstr)
Jim Stichnothf7c9a142014-04-29 10:52:43 -070055
Karl Schimpfd6064a12014-08-27 15:34:58 -070056// Dictionary:
57// V - Is vector type.
58// I - Is integer value (scalar or vector).
59// F - Is floating point value (scalar or vector).
60// IA - Is integer arithmetic type
Karl Schimpf41689df2014-09-10 14:36:07 -070061// LS - true if load/store allowed on type.
Karl Schimpfff94f592015-09-18 10:37:44 -070062// P - true if can be used for parameter of call.
Karl Schimpf83f9f0c2014-09-05 08:30:55 -070063// CR - Result type of compare instruction for argument type
64// (IceType_void if disallowed)
Karl Schimpfff94f592015-09-18 10:37:44 -070065#define ICETYPE_PROPS_TABLE \
Jim Stichnothc59288b2015-11-09 11:38:40 -080066 /* Enum Value V I F IA LS P CR */ \
67 X(void, 0, 0, 0, 0, 0, 0, void) \
68 X(i1, 0, 1, 0, 0, 0, 0, i1) \
69 X(i8, 0, 1, 0, 1, 1, 0, i1) \
70 X(i16, 0, 1, 0, 1, 1, 0, i1) \
71 X(i32, 0, 1, 0, 1, 1, 1, i1) \
72 X(i64, 0, 1, 0, 1, 1, 1, i1) \
73 X(f32, 0, 0, 1, 0, 1, 1, i1) \
74 X(f64, 0, 0, 1, 0, 1, 1, i1) \
75 X(v4i1, 1, 1, 0, 0, 0, 1, v4i1) \
76 X(v8i1, 1, 1, 0, 0, 0, 1, v8i1) \
77 X(v16i1, 1, 1, 0, 0, 0, 1, v16i1) \
78 X(v16i8, 1, 1, 0, 1, 1, 1, v16i1) \
79 X(v8i16, 1, 1, 0, 1, 1, 1, v8i1) \
80 X(v4i32, 1, 1, 0, 1, 1, 1, v4i1) \
81 X(v4f32, 1, 0, 1, 0, 1, 1, v4i1) \
Karl Schimpfff94f592015-09-18 10:37:44 -070082//#define X(tag, IsVec, IsInt, IsFloat, IsIntArith, IsLoadStore, IsParam, \
83// CompareResult)
Karl Schimpfd6064a12014-08-27 15:34:58 -070084
Jim Stichnothf7c9a142014-04-29 10:52:43 -070085#endif // SUBZERO_SRC_ICETYPES_DEF