[LoongArch64] Part-5:add loongarch support in some files for LoongArch64. (#21769)
[mono-project.git] / mono / utils / mono-machine.h
blob922b5d282f58d61b74f99e20bd46d0b5956bc66a
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 ... machine register size of target machine
35 * TARGET_SIZEOF_VOID_P ... pointer size of target machine
37 * SIZEOF_REGISTER is usually the same as TARGET_SIZEOF_VOID_P, except when MONO_ARCH_ILP32 is defined
39 #if SIZEOF_REGISTER == 4
40 typedef gint32 target_mgreg_t;
41 #else
42 typedef gint64 target_mgreg_t;
43 #endif
45 /* Alignment for MonoArray.vector */
46 #if defined(_AIX)
48 * HACK: doubles in structs always align to 4 on AIX... even on 64-bit,
49 * which is bad for aligned usage like what System.Array.FastCopy does
51 typedef guint64 mono_64bitaligned_t;
52 #else
53 typedef double mono_64bitaligned_t;
54 #endif
56 #endif /* __MONO_MONO_MACHINE_H__ */