s390x: reconsider "long displacement" requirement.  We currently
require that the host supports accessing memory using long
displacement. On older machines e.g. z900 that is an expensive
operation, because it is millicoded. It would be a performance win to
relax that requirement.  (VEX side changes.)  See #268620.
(Florian Krohm, britzel@acm.org)



git-svn-id: svn://svn.valgrind.org/vex/trunk@2126 8f6e269a-dfd6-0310-a8e1-e2731360e62c
diff --git a/priv/host_s390_isel.c b/priv/host_s390_isel.c
index 80e5759..beb03b3 100644
--- a/priv/host_s390_isel.c
+++ b/priv/host_s390_isel.c
@@ -227,7 +227,9 @@
          if (ulong_fits_unsigned_12bit(value)) {
             return s390_amode_b12((Int)value, s390_isel_int_expr(env, arg1));
          }
-         if (ulong_fits_signed_20bit(value)) {
+         /* If long-displacement is not available, do not construct B20 or
+            BX20 amodes because code generation cannot handle them. */
+         if (s390_host_has_ldisp && ulong_fits_signed_20bit(value)) {
             return s390_amode_b20((Int)value, s390_isel_int_expr(env, arg1));
          }
       }
@@ -2350,9 +2352,8 @@
    /* KLUDGE: export archinfo_host. */
    s390_archinfo_host = archinfo_host;
 
-
    /* Do some sanity checks */
-   vassert((hwcaps_host & ~(VEX_HWCAPS_S390X_ALL)) == 0);
+   vassert((VEX_HWCAPS_S390X(hwcaps_host) & ~(VEX_HWCAPS_S390X_ALL)) == 0);
 
    /* Make up an initial environment to use. */
    env = LibVEX_Alloc(sizeof(ISelEnv));