Use expression-bodied members in more places (dotnet/coreclr#26500)
[mono-project.git] / mono / utils / mono-machine.h
blob036e7b1f996ebbd159b22781be3495873d8406dc
1 /**
2 * \file
3 * machine definitions
5 * Authors:
6 * Rodrigo Kumpera (kumpera@gmail.com)
8 * Copyright (c) 2011 Novell, Inc (http://www.novell.com)
9 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
12 #ifndef __MONO_MONO_MACHINE_H__
13 #define __MONO_MONO_MACHINE_H__
15 /* C type matching the size of a machine register. Not always the same as 'int' */
16 /* Note that member 'p' of MonoInst must be the same type, as OP_PCONST is defined
17 * as one of the OP_ICONST types, so inst_c0 must be the same as inst_p0
20 #include "config.h"
21 #include <glib.h>
23 // __ILP32__ means integer, long, and pointers are 32bits, and nothing about registers.
24 // MONO_ARCH_ILP32 means integer, long, and pointers are 32bits, and 64bit registers.
25 // This is for example x32, arm6432, mipsn32, Alpha/NT.
26 #ifdef MONO_ARCH_ILP32
27 typedef gint64 host_mgreg_t;
28 typedef guint64 host_umgreg_t;
29 #else
30 typedef gssize host_mgreg_t;
31 typedef gsize host_umgreg_t;
32 #endif
34 // SIZEOF_REGISTER is target. mgreg_t is usually target, sometimes host.
35 // There is a mismatch in cross (AOT) compilers, and the
36 // never executed JIT and runtime truncate pointers.
37 // When casting to/from pointers, use gsize or gssize.
38 // When dealing with register context, use host_mgreg_t.
39 // Or ifndef MONO_CROSS_COMPILE out runtime code.
40 #if SIZEOF_REGISTER == 4
41 //typedef gint32 mgreg_t;
42 #elif SIZEOF_REGISTER == 8
43 //typedef gint64 mgreg_t;
44 #endif
46 #if TARGET_SIZEOF_VOID_P == 4
47 typedef gint32 target_mgreg_t;
48 #else
49 typedef gint64 target_mgreg_t;
50 #endif
52 /* Alignment for MonoArray.vector */
53 #if defined(_AIX)
55 * HACK: doubles in structs always align to 4 on AIX... even on 64-bit,
56 * which is bad for aligned usage like what System.Array.FastCopy does
58 typedef guint64 mono_64bitaligned_t;
59 #else
60 typedef double mono_64bitaligned_t;
61 #endif
63 #endif /* __MONO_MONO_MACHINE_H__ */