8189616: [s390] Remove definition and all uses of STCK instruction
Reviewed-by: mdoerr
--- a/src/hotspot/cpu/s390/assembler_s390.hpp Mon Oct 23 03:15:19 2017 -0400
+++ b/src/hotspot/cpu/s390/assembler_s390.hpp Mon Oct 23 11:56:30 2017 +0200
@@ -1310,7 +1310,6 @@
#define LAOG_ZOPC (unsigned long)(0xebL << 40 | 0xe6L) // z196
// System Functions
-#define STCK_ZOPC (unsigned int)(0xb2 << 24 | 0x05 << 16)
#define STCKF_ZOPC (unsigned int)(0xb2 << 24 | 0x7c << 16)
#define STFLE_ZOPC (unsigned int)(0xb2 << 24 | 0xb0 << 16)
#define ECTG_ZOPC (unsigned long)(0xc8L <<40 | 0x01L << 32) // z10
@@ -3035,7 +3034,6 @@
inline void z_ahhlr(Register r1, Register r2, Register r3); // ADD halfword high low
inline void z_tam();
- inline void z_stck(int64_t d2, Register b2);
inline void z_stckf(int64_t d2, Register b2);
inline void z_stmg(Register r1, Register r3, int64_t d2, Register b2);
inline void z_lmg(Register r1, Register r3, int64_t d2, Register b2);
--- a/src/hotspot/cpu/s390/assembler_s390.inline.hpp Mon Oct 23 03:15:19 2017 -0400
+++ b/src/hotspot/cpu/s390/assembler_s390.inline.hpp Mon Oct 23 11:56:30 2017 +0200
@@ -689,7 +689,6 @@
inline void Assembler::z_ahhlr(Register r1, Register r2, Register r3) { emit_32( AHHLR_ZOPC | reg(r3, 16, 32) | reg(r1, 24, 32) | reg(r2, 28, 32)); }
inline void Assembler::z_tam() { emit_16( TAM_ZOPC); }
-inline void Assembler::z_stck(int64_t d2, Register b2) { emit_32( STCK_ZOPC | uimm12(d2, 20, 32) | regz(b2, 16, 32)); }
inline void Assembler::z_stckf(int64_t d2, Register b2) { emit_32( STCKF_ZOPC | uimm12(d2, 20, 32) | regz(b2, 16, 32)); }
inline void Assembler::z_stmg(Register r1, Register r3, int64_t d2, Register b2) { emit_48( STMG_ZOPC | simm20(d2) | reg(r1, 8, 48) | reg(r3,12,48)| reg(b2,16,48) ); }
inline void Assembler::z_lmg(Register r1, Register r3, int64_t d2, Register b2) { emit_48( LMG_ZOPC | simm20(d2) | reg(r1, 8, 48) | reg(r3,12,48)| reg(b2,16,48) ); }
--- a/src/hotspot/cpu/s390/vm_version_s390.cpp Mon Oct 23 03:15:19 2017 -0400
+++ b/src/hotspot/cpu/s390/vm_version_s390.cpp Mon Oct 23 11:56:30 2017 +0200
@@ -707,13 +707,12 @@
Label getCIPHERFEATURES; // fcode = -2 (cipher)
Label getMSGDIGESTFEATURES; // fcode = -3 (SHA)
Label getVECTORFEATURES; // fcode = -4 (OS support for vector instructions)
- Label checkLongDispFast;
- Label noLongDisp;
- Label posDisp, negDisp;
Label errRTN;
a->z_ltgfr(Z_R0, Z_ARG2); // Buf len to r0 and test.
a->z_brl(getFEATURES); // negative -> Get machine features not covered by facility list.
- a->z_brz(checkLongDispFast); // zero -> Check for high-speed Long Displacement Facility.
+ a->z_lghi(Z_R1,0);
+ a->z_brz(errRTN); // zero -> Function code currently not used, indicate "aborted".
+
a->z_aghi(Z_R0, -1);
a->z_stfle(0, Z_ARG1);
a->z_lg(Z_R1, 0, Z_ARG1); // Get first DW of facility list.
@@ -774,48 +773,6 @@
a->z_vtm(Z_V0,Z_V0); // non-destructive vector instruction. Will cause SIGFPE if not supported.
a->z_br(Z_R14);
- // Check the performance of the Long Displacement Facility, i.e. find out if we are running on z900 or newer.
- a->bind(checkLongDispFast);
- a->z_llill(Z_R0, 0xffff); // preset #iterations
- a->z_larl(Z_R1, posDisp);
- a->z_stck(0, Z_ARG1); // Get begin timestamp.
-
- a->bind(posDisp); // Positive disp loop.
- a->z_lg(Z_ARG2, 0, Z_ARG1);
- a->z_bctgr(Z_R0, Z_R1);
-
- a->z_stck(0, Z_ARG1); // Get end timestamp.
- a->z_sg(Z_ARG2, 0, Z_R0, Z_ARG1); // Calculate elapsed time.
- a->z_lcgr(Z_ARG2, Z_ARG2);
- a->z_srlg(Z_ARG2, Z_ARG2, 12); // LSB: now microseconds
- a->z_stg(Z_ARG2, 8, Z_ARG1); // Store difference in buffer[1].
-
- a->z_llill(Z_R0, 0xffff); // preset #iterations
- a->z_larl(Z_R1, negDisp);
- a->z_xgr(Z_ARG2, Z_ARG2); // Clear to detect absence of LongDisp facility.
- a->z_stck(0, Z_ARG1); // Get begin timestamp.
- a->z_la(Z_ARG1, 8, Z_ARG1);
-
- a->bind(negDisp); // Negative disp loop.
- a->z_lg(Z_ARG2, -8, Z_ARG1);
- a->z_bctgr(Z_R0, Z_R1);
-
- a->z_aghi(Z_ARG1, -8);
- a->z_stck(0, Z_ARG1); // Get end timestamp.
- a->z_ltgr(Z_ARG2, Z_ARG2); // Check for absence of LongDisp facility.
- a->z_brz(noLongDisp);
- a->z_sg(Z_ARG2, 0, Z_R0, Z_ARG1); // Calc elapsed time.
- a->z_lcgr(Z_ARG2, Z_ARG2);
- a->z_srlg(Z_ARG2, Z_ARG2, 12); // LSB: now microseconds
- a->z_stg(Z_ARG2, 0, Z_ARG1); // store difference in buffer[0]
-
- a->z_llill(Z_RET,0xffff);
- a->z_br(Z_R14);
-
- a->bind(noLongDisp);
- a->z_lghi(Z_RET,-1);
- a->z_br(Z_R14);
-
address code_end = a->pc();
a->flush();