@@ -143,6 +143,17 @@ static char __CLOSURE_GET_DATA_BYTES[] = {
143
143
0x03, 0xA5, 0x0F, 0x00, // lw a0, 0(t6)
144
144
0x67, 0x80, 0x00, 0x00 // ret
145
145
};
146
+ #elif defined (__V_s390x)
147
+ static char __closure_thunk[] = {
148
+ 0xC0, 0x30, 0xFF, 0xFF, 0xE0, 0x00, // larl %r3, -16384
149
+ 0xE3, 0x40, 0x30, 0x00, 0x00, 0x04, // lg %r4, 0(%r3)
150
+ 0xE3, 0x30, 0x30, 0x08, 0x00, 0x04, // lg %r3, 8(%r3)
151
+ 0x07, 0xF3, // br %r3
152
+ };
153
+ static char __CLOSURE_GET_DATA_BYTES[] = {
154
+ 0xB9, 0x04, 0x00, 0x24, // lgr %r2, %r4
155
+ 0x07, 0xFE, // br %r14
156
+ };
146
157
#endif
147
158
148
159
static void*(*__CLOSURE_GET_DATA)(void) = 0;
@@ -301,6 +312,12 @@ const c_common_macros = '
301
312
#define __V_architecture 6
302
313
#endif
303
314
315
+ #if defined(__s390x__)
316
+ #define __V_s390x 1
317
+ #undef __V_architecture
318
+ #define __V_architecture 7
319
+ #endif
320
+
304
321
// Using just __GNUC__ for detecting gcc, is not reliable because other compilers define it too:
305
322
#ifdef __GNUC__
306
323
#define __V_GCC__
@@ -658,7 +675,7 @@ static void* g_live_info = NULL;
658
675
659
676
const c_builtin_types = '
660
677
//================================== builtin types ================================*/
661
- #if defined(__x86_64__) || defined(_M_AMD64) || defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64) || (defined(__riscv_xlen) && __riscv_xlen == 64)
678
+ #if defined(__x86_64__) || defined(_M_AMD64) || defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64) || (defined(__riscv_xlen) && __riscv_xlen == 64) || defined(__s390x__)
662
679
typedef int64_t vint_t;
663
680
#else
664
681
typedef int32_t vint_t;
0 commit comments