summaryrefslogtreecommitdiff
path: root/opcodes/s390-dis.c
diff options
context:
space:
mode:
Diffstat (limited to 'opcodes/s390-dis.c')
-rw-r--r--opcodes/s390-dis.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/opcodes/s390-dis.c b/opcodes/s390-dis.c
index 33121c78b70..42f5151d3f0 100644
--- a/opcodes/s390-dis.c
+++ b/opcodes/s390-dis.c
@@ -89,6 +89,10 @@ s390_extract_operand (insn, operand)
val >>= -bits;
val &= ((1U << (operand->bits - 1)) << 1) - 1;
+ /* Check for special long displacement case. */
+ if (operand->bits == 20 && operand->shift == 20)
+ val = (val & 0xff) << 12 | (val & 0xfff00) >> 8;
+
/* Sign extend value if the operand is signed or pc relative. */
if ((operand->flags & (S390_OPERAND_SIGNED | S390_OPERAND_PCREL))
&& (val & (1U << (operand->bits - 1))))