blob: 0b85ad6355b3e9eeb002a93389245cb3ff6a0918 [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//
10// This file defines properties of ICE primitive types in the form of
11// x-macros.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef SUBZERO_SRC_ICETYPES_DEF
16#define SUBZERO_SRC_ICETYPES_DEF
17
Jan Voung08c3bcd2014-12-01 17:55:16 -080018// Attributes of each target architecture.
19// NOTE on is_elf64 -- At some point NaCl would like to use ELF32 for all
20// ILP32 sandboxes, but for now the 64-bit architectures use ELF64:
21// https://code.google.com/p/nativeclient/issues/detail?id=349
22// TODO: Whoever adds AArch64 will need to set ABI e_flags.
23#define TARGETARCH_TABLE \
24 /* enum value, printable string, is_elf64, e_machine, e_flags */ \
25 X(Target_X8632, "x86-32", false, EM_386, 0) \
26 X(Target_X8664, "x86-64", true, EM_X86_64, 0) \
27 X(Target_ARM32, "arm32", false, EM_ARM, EF_ARM_EABI_VER5) \
28 X(Target_ARM64, "arm64", true, EM_AARCH64, 0) \
29 //#define X(tag, str, is_elf64, e_machine, e_flags)
Karl Schimpfb262c5e2014-10-27 14:41:57 -070030
Matt Wala928f1292014-07-07 16:50:46 -070031#define ICETYPE_TABLE \
32 /* enum value, size, align, # elts, element type, printable string */ \
33 /* (size and alignment in bytes) */ \
34 X(IceType_void, 0, 0, 1, IceType_void, "void") \
35 X(IceType_i1, 1, 1, 1, IceType_i1, "i1") \
36 X(IceType_i8, 1, 1, 1, IceType_i8, "i8") \
37 X(IceType_i16, 2, 1, 1, IceType_i16, "i16") \
38 X(IceType_i32, 4, 1, 1, IceType_i32, "i32") \
39 X(IceType_i64, 8, 1, 1, IceType_i64, "i64") \
40 X(IceType_f32, 4, 4, 1, IceType_f32, "float") \
41 X(IceType_f64, 8, 8, 1, IceType_f64, "double") \
42 X(IceType_v4i1, 16, 1, 4, IceType_i1, "<4 x i1>") \
43 X(IceType_v8i1, 16, 1, 8, IceType_i1, "<8 x i1>") \
44 X(IceType_v16i1, 16, 1, 16, IceType_i1, "<16 x i1>") \
45 X(IceType_v16i8, 16, 1, 16, IceType_i8, "<16 x i8>") \
46 X(IceType_v8i16, 16, 2, 8, IceType_i16, "<8 x i16>") \
47 X(IceType_v4i32, 16, 4, 4, IceType_i32, "<4 x i32>") \
48 X(IceType_v4f32, 16, 4, 4, IceType_f32, "<4 x float>") \
49//#define X(tag, size, align, elts, elty, str)
Jim Stichnothf7c9a142014-04-29 10:52:43 -070050
Karl Schimpfd6064a12014-08-27 15:34:58 -070051// 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 Schimpf41689df2014-09-10 14:36:07 -070056// LS - true if load/store allowed on type.
Karl Schimpf83f9f0c2014-09-05 08:30:55 -070057// CR - Result type of compare instruction for argument type
58// (IceType_void if disallowed)
Karl Schimpfd6064a12014-08-27 15:34:58 -070059#define ICETYPE_PROPS_TABLE \
Karl Schimpf41689df2014-09-10 14:36:07 -070060 /* Enum Value V I F IA LS CR */ \
61 X(IceType_void, 0, 0, 0, 0, 0, IceType_void) \
62 X(IceType_i1, 0, 1, 0, 0, 0, IceType_i1) \
63 X(IceType_i8, 0, 1, 0, 1, 1, IceType_i1) \
64 X(IceType_i16, 0, 1, 0, 1, 1, IceType_i1) \
65 X(IceType_i32, 0, 1, 0, 1, 1, IceType_i1) \
66 X(IceType_i64, 0, 1, 0, 1, 1, IceType_i1) \
67 X(IceType_f32, 0, 0, 1, 0, 1, IceType_i1) \
68 X(IceType_f64, 0, 0, 1, 0, 1, IceType_i1) \
69 X(IceType_v4i1, 1, 1, 0, 0, 0, IceType_v4i1) \
70 X(IceType_v8i1, 1, 1, 0, 0, 0, IceType_v8i1) \
71 X(IceType_v16i1, 1, 1, 0, 0, 0, IceType_v16i1) \
72 X(IceType_v16i8, 1, 1, 0, 1, 1, IceType_v16i1) \
73 X(IceType_v8i16, 1, 1, 0, 1, 1, IceType_v8i1) \
74 X(IceType_v4i32, 1, 1, 0, 1, 1, IceType_v4i1) \
75 X(IceType_v4f32, 1, 0, 1, 0, 1, IceType_v4i1) \
76//#define X(tag, IsVec, IsInt, IsFloat, IsIntArith, IsLoadStore, CompareResult)
Karl Schimpfd6064a12014-08-27 15:34:58 -070077
Jim Stichnothf7c9a142014-04-29 10:52:43 -070078#endif // SUBZERO_SRC_ICETYPES_DEF