From 52bcd122d10fba07ff4838de6b1938b02cb233cb Mon Sep 17 00:00:00 2001 From: Florian Krohm Date: Mon, 8 Dec 2014 12:42:26 +0000 Subject: [PATCH] Export s390_host_hwcaps in LibVEX_Translate, so we can use it in are_valid_hwcaps. git-svn-id: svn://svn.valgrind.org/vex/trunk@3033 --- VEX/priv/host_s390_defs.c | 3 +-- VEX/priv/host_s390_isel.c | 3 --- VEX/priv/main_main.c | 2 ++ 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/VEX/priv/host_s390_defs.c b/VEX/priv/host_s390_defs.c index f358a950de..0599009776 100644 --- a/VEX/priv/host_s390_defs.c +++ b/VEX/priv/host_s390_defs.c @@ -48,8 +48,7 @@ code. But that info is not passed to emit_S390Instr. Only mode64 is being passed. So, ideally, we want this passed as an argument, too. 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. */ + effect of LibVEX_Translate. */ UInt s390_host_hwcaps; diff --git a/VEX/priv/host_s390_isel.c b/VEX/priv/host_s390_isel.c index fc320144e1..8317e67745 100644 --- a/VEX/priv/host_s390_isel.c +++ b/VEX/priv/host_s390_isel.c @@ -4060,9 +4060,6 @@ iselSB_S390(IRSB *bb, VexArch arch_host, const VexArchInfo *archinfo_host, ISelEnv *env; UInt hwcaps_host = archinfo_host->hwcaps; - /* KLUDGE: export hwcaps. */ - s390_host_hwcaps = hwcaps_host; - /* Do some sanity checks */ vassert((VEX_HWCAPS_S390X(hwcaps_host) & ~(VEX_HWCAPS_S390X_ALL)) == 0); diff --git a/VEX/priv/main_main.c b/VEX/priv/main_main.c index 175c6137fc..905b9eef4a 100644 --- a/VEX/priv/main_main.c +++ b/VEX/priv/main_main.c @@ -369,6 +369,8 @@ VexTranslateResult LibVEX_Translate ( VexTranslateArgs* vta ) case VexArchS390X: mode64 = True; + /* KLUDGE: export hwcaps. */ + s390_host_hwcaps = vta->archinfo_host.hwcaps; getAllocableRegs_S390 ( &n_available_real_regs, &available_real_regs, mode64 ); isMove = (__typeof__(isMove)) isMove_S390Instr; -- 2.47.2