|
From: <sv...@va...> - 2012-04-21 16:06:12
|
florian 2012-04-21 17:06:04 +0100 (Sat, 21 Apr 2012)
New Revision: 2305
Log:
(post-tchain-merge cleanup): Use ASI and AGSI for increment / decrement if
available.
Modified files:
trunk/priv/host_s390_defs.c
Modified: trunk/priv/host_s390_defs.c (+27 -8)
===================================================================
--- trunk/priv/host_s390_defs.c 2012-04-21 16:53:13 +01:00 (rev 2304)
+++ trunk/priv/host_s390_defs.c 2012-04-21 17:06:04 +01:00 (rev 2305)
@@ -1318,6 +1318,18 @@
static UChar *
+s390_emit_ASI(UChar *p, UChar i2, UChar b1, UShort dl1, UChar dh1)
+{
+ vassert(s390_host_has_gie);
+
+ if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM))
+ s390_disasm(ENC3(MNM, INT, SDXB), "asi", (Int)(Char)i2, dh1, dl1, 0, b1);
+
+ return emit_SIY(p, 0xeb000000006aULL, i2, b1, dl1, dh1);
+}
+
+
+static UChar *
s390_emit_NR(UChar *p, UChar r1, UChar r2)
{
if (UNLIKELY(vex_traceflags & VEX_TRACE_ASM))
@@ -7560,10 +7572,13 @@
d = amode->d;
/* Decrement the dispatch counter in the guest state */
- /* fixs390: ASI if available */
- buf = s390_emit_LHI(buf, R0, -1); /* 4 bytes */
- buf = s390_emit_A(buf, R0, 0, b, d); /* 4 bytes */
- buf = s390_emit_ST(buf, R0, 0, b, d); /* 4 bytes */
+ if (s390_host_has_gie) {
+ buf = s390_emit_ASI(buf, -1, b, DISP20(d)); /* 6 bytes */
+ } else {
+ buf = s390_emit_LHI(buf, R0, -1); /* 4 bytes */
+ buf = s390_emit_A(buf, R0, 0, b, d); /* 4 bytes */
+ buf = s390_emit_ST(buf, R0, 0, b, d); /* 4 bytes */
+ }
/* Jump over the next insn if >= 0 */
buf = s390_emit_BRC(buf, S390_CC_HE, (4 + 6 + 2) / 2); /* 4 bytes */
@@ -7594,9 +7609,13 @@
template will be patched once the memory location is known.
For now we do this with address == 0. */
buf = s390_tchain_load64(buf, S390_REGNO_TCHAIN_SCRATCH, 0);
- buf = s390_emit_LGHI(buf, R0, 1);
- buf = s390_emit_AG( buf, R0, 0, S390_REGNO_TCHAIN_SCRATCH, DISP20(0));
- buf = s390_emit_STG(buf, R0, 0, S390_REGNO_TCHAIN_SCRATCH, DISP20(0));
+ if (s390_host_has_gie) {
+ buf = s390_emit_AGSI(buf, 1, S390_REGNO_TCHAIN_SCRATCH, DISP20(0));
+ } else {
+ buf = s390_emit_LGHI(buf, R0, 1);
+ buf = s390_emit_AG( buf, R0, 0, S390_REGNO_TCHAIN_SCRATCH, DISP20(0));
+ buf = s390_emit_STG(buf, R0, 0, S390_REGNO_TCHAIN_SCRATCH, DISP20(0));
+ }
return buf;
}
@@ -7762,7 +7781,7 @@
Int
evCheckSzB_S390(void)
{
- return 24;
+ return s390_host_has_gie ? 18 : 24;
}
|