Until then, we use a global variable. This variable is set as a side
effect of iselSB_S390. This is safe because instructions are selected
before they are emitted. */
-const VexArchInfo *s390_archinfo_host;
+UInt s390_host_hwcaps;
/*------------------------------------------------------------*/
ULong *location_of_counter);
/* KLUDGE: See detailled comment in host_s390_defs.c. */
-extern const VexArchInfo *s390_archinfo_host;
+extern UInt s390_host_hwcaps;
/* Convenience macros to test installed facilities */
#define s390_host_has_ldisp \
- (s390_archinfo_host->hwcaps & (VEX_HWCAPS_S390X_LDISP))
+ (s390_host_hwcaps & (VEX_HWCAPS_S390X_LDISP))
#define s390_host_has_eimm \
- (s390_archinfo_host->hwcaps & (VEX_HWCAPS_S390X_EIMM))
+ (s390_host_hwcaps & (VEX_HWCAPS_S390X_EIMM))
#define s390_host_has_gie \
- (s390_archinfo_host->hwcaps & (VEX_HWCAPS_S390X_GIE))
+ (s390_host_hwcaps & (VEX_HWCAPS_S390X_GIE))
#define s390_host_has_dfp \
- (s390_archinfo_host->hwcaps & (VEX_HWCAPS_S390X_DFP))
+ (s390_host_hwcaps & (VEX_HWCAPS_S390X_DFP))
#define s390_host_has_fgx \
- (s390_archinfo_host->hwcaps & (VEX_HWCAPS_S390X_FGX))
+ (s390_host_hwcaps & (VEX_HWCAPS_S390X_FGX))
#define s390_host_has_etf2 \
- (s390_archinfo_host->hwcaps & (VEX_HWCAPS_S390X_ETF2))
+ (s390_host_hwcaps & (VEX_HWCAPS_S390X_ETF2))
#endif /* ndef __VEX_HOST_S390_DEFS_H */
/*--- Insn selector top-level ---*/
/*---------------------------------------------------------*/
-/* Translate an entire SB to s390 code. */
+/* Translate an entire SB to s390 code.
+ Note: archinfo_host is a pointer to a stack-allocated variable.
+ Do not assign it to a global variable! */
HInstrArray *
iselSB_S390(IRSB *bb, VexArch arch_host, VexArchInfo *archinfo_host,
ISelEnv *env;
UInt hwcaps_host = archinfo_host->hwcaps;
- /* KLUDGE: export archinfo_host. */
- s390_archinfo_host = archinfo_host;
+ /* KLUDGE: export hwcaps. */
+ s390_host_hwcaps = hwcaps_host;
/* Do some sanity checks */
vassert((VEX_HWCAPS_S390X(hwcaps_host) & ~(VEX_HWCAPS_S390X_ALL)) == 0);