Skip to content

Commit

Permalink
s390x: allow lifting of vector instructions
Browse files Browse the repository at this point in the history
guest_s390_toIR lifts vector instructions only if host supports them,
which is never going to happen when using it on x86, so let's fool the
check.

Additionally, in context of rebasing discussion, I thought it would
make sense to make hacks like this stand out. So I wrapped it in PYVEX
ifdef.
  • Loading branch information
mephi42 authored and rhelmot committed Jan 22, 2020
1 parent 074d71b commit 744bc19
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile-gcc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ CFLAGS := -Ipub -Ipriv \
-Wcast-align -Wmissing-declarations \
-Wwrite-strings -Wformat -Wformat-security \
-std=gnu99 -fstrict-aliasing -fPIC \
-DPYVEX \
$(EXTRA_CFLAGS)

# If not debugging, put -g -O2 after any flags we inherit from our invoker
Expand Down
2 changes: 1 addition & 1 deletion Makefile-msvc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ STATIC_LIBRARY_FILE = libvex.lib
DYNAMIC_LIBRARY_FILE = libvex.dll
EXTRA_CLEAN_FILES = auxprogs/genoffsets.exe genoffsets.obj

CCFLAGS = /Ipub /Ipriv $(EXTRA_CFLAGS) /O2 /wd4715
CCFLAGS = /Ipub /Ipriv $(EXTRA_CFLAGS) /O2 /wd4715 /DPYVEX

all: vex

Expand Down
5 changes: 5 additions & 0 deletions priv/main_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,11 @@ IRSB *LibVEX_Lift ( VexTranslateArgs *vta,
if (vta->arch_host == VexArchS390X) {
s390_host_hwcaps = vta->archinfo_host.hwcaps;
}
#ifdef PYVEX
if (vta->arch_guest == VexArchS390X) {
s390_host_hwcaps |= VEX_HWCAPS_S390X_LDISP | VEX_HWCAPS_S390X_VX;
}
#endif

/* First off, check that the guest and host insn sets
are supported. */
Expand Down

0 comments on commit 744bc19

Please sign in to comment.