This commit is contained in:
Dean Long 2016-09-27 20:55:13 -04:00
commit 632120bcd7
119 changed files with 2333 additions and 1485 deletions

View file

@ -31,6 +31,7 @@ $(eval $(call IncludeCustomExtension, hotspot, lib/JvmOverrideFiles.gmk))
ifeq ($(TOOLCHAIN_TYPE), gcc) ifeq ($(TOOLCHAIN_TYPE), gcc)
BUILD_LIBJVM_vmStructs.cpp_CXXFLAGS := -fno-var-tracking-assignments -O0 BUILD_LIBJVM_vmStructs.cpp_CXXFLAGS := -fno-var-tracking-assignments -O0
BUILD_LIBJVM_jvmciCompilerToVM.cpp_CXXFLAGS := -fno-var-tracking-assignments
endif endif
ifeq ($(OPENJDK_TARGET_OS), linux) ifeq ($(OPENJDK_TARGET_OS), linux)

View file

@ -140,10 +140,11 @@ LIR_Opr LIRGenerator::safepoint_poll_register() {
LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index, LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index,
int shift, int disp, BasicType type) { int shift, int disp, BasicType type) {
assert(base->is_register(), "must be"); assert(base->is_register(), "must be");
intx large_disp = disp;
// accumulate fixed displacements // accumulate fixed displacements
if (index->is_constant()) { if (index->is_constant()) {
disp += index->as_constant_ptr()->as_jint() << shift; large_disp += (intx)(index->as_constant_ptr()->as_jint()) << shift;
index = LIR_OprFact::illegalOpr; index = LIR_OprFact::illegalOpr;
} }
@ -154,31 +155,31 @@ LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index,
__ shift_left(index, shift, tmp); __ shift_left(index, shift, tmp);
index = tmp; index = tmp;
} }
if (disp != 0) { if (large_disp != 0) {
LIR_Opr tmp = new_pointer_register(); LIR_Opr tmp = new_pointer_register();
if (Assembler::operand_valid_for_add_sub_immediate(disp)) { if (Assembler::operand_valid_for_add_sub_immediate(large_disp)) {
__ add(tmp, tmp, LIR_OprFact::intptrConst(disp)); __ add(tmp, tmp, LIR_OprFact::intptrConst(large_disp));
index = tmp; index = tmp;
} else { } else {
__ move(tmp, LIR_OprFact::intptrConst(disp)); __ move(tmp, LIR_OprFact::intptrConst(large_disp));
__ add(tmp, index, tmp); __ add(tmp, index, tmp);
index = tmp; index = tmp;
} }
disp = 0; large_disp = 0;
} }
} else if (disp != 0 && !Address::offset_ok_for_immed(disp, shift)) { } else if (large_disp != 0 && !Address::offset_ok_for_immed(large_disp, shift)) {
// index is illegal so replace it with the displacement loaded into a register // index is illegal so replace it with the displacement loaded into a register
index = new_pointer_register(); index = new_pointer_register();
__ move(LIR_OprFact::intptrConst(disp), index); __ move(LIR_OprFact::intptrConst(large_disp), index);
disp = 0; large_disp = 0;
} }
// at this point we either have base + index or base + displacement // at this point we either have base + index or base + displacement
if (disp == 0) { if (large_disp == 0) {
return new LIR_Address(base, index, type); return new LIR_Address(base, index, type);
} else { } else {
assert(Address::offset_ok_for_immed(disp, 0), "must be"); assert(Address::offset_ok_for_immed(large_disp, 0), "must be");
return new LIR_Address(base, disp, type); return new LIR_Address(base, large_disp, type);
} }
} }
@ -192,7 +193,7 @@ LIR_Address* LIRGenerator::emit_array_address(LIR_Opr array_opr, LIR_Opr index_o
LIR_Address* addr; LIR_Address* addr;
if (index_opr->is_constant()) { if (index_opr->is_constant()) {
addr = new LIR_Address(array_opr, addr = new LIR_Address(array_opr,
offset_in_bytes + index_opr->as_jint() * elem_size, type); offset_in_bytes + (intx)(index_opr->as_jint()) * elem_size, type);
} else { } else {
if (offset_in_bytes) { if (offset_in_bytes) {
LIR_Opr tmp = new_pointer_register(); LIR_Opr tmp = new_pointer_register();
@ -1032,6 +1033,10 @@ void LIRGenerator::do_update_CRC32C(Intrinsic* x) {
Unimplemented(); Unimplemented();
} }
void LIRGenerator::do_FmaIntrinsic(Intrinsic* x) {
fatal("FMA intrinsic is not implemented on this platform");
}
void LIRGenerator::do_vectorizedMismatch(Intrinsic* x) { void LIRGenerator::do_vectorizedMismatch(Intrinsic* x) {
fatal("vectorizedMismatch intrinsic is not implemented on this platform"); fatal("vectorizedMismatch intrinsic is not implemented on this platform");
} }

View file

@ -262,6 +262,11 @@ void VM_Version::get_processor_features() {
FLAG_SET_DEFAULT(UseCRC32CIntrinsics, false); FLAG_SET_DEFAULT(UseCRC32CIntrinsics, false);
} }
if (UseFMA) {
warning("FMA instructions are not available on this CPU");
FLAG_SET_DEFAULT(UseFMA, false);
}
if (auxv & (HWCAP_SHA1 | HWCAP_SHA2)) { if (auxv & (HWCAP_SHA1 | HWCAP_SHA2)) {
if (FLAG_IS_DEFAULT(UseSHA)) { if (FLAG_IS_DEFAULT(UseSHA)) {
FLAG_SET_DEFAULT(UseSHA, true); FLAG_SET_DEFAULT(UseSHA, true);

View file

@ -506,6 +506,8 @@ class Assembler : public AbstractAssembler {
// Vector-Scalar (VSX) instruction support. // Vector-Scalar (VSX) instruction support.
LXVD2X_OPCODE = (31u << OPCODE_SHIFT | 844u << 1), LXVD2X_OPCODE = (31u << OPCODE_SHIFT | 844u << 1),
STXVD2X_OPCODE = (31u << OPCODE_SHIFT | 972u << 1), STXVD2X_OPCODE = (31u << OPCODE_SHIFT | 972u << 1),
MTVSRD_OPCODE = (31u << OPCODE_SHIFT | 179u << 1),
MFVSRD_OPCODE = (31u << OPCODE_SHIFT | 51u << 1),
// Vector Permute and Formatting // Vector Permute and Formatting
VPKPX_OPCODE = (4u << OPCODE_SHIFT | 782u ), VPKPX_OPCODE = (4u << OPCODE_SHIFT | 782u ),
@ -2099,6 +2101,8 @@ class Assembler : public AbstractAssembler {
// Vector-Scalar (VSX) instructions. // Vector-Scalar (VSX) instructions.
inline void lxvd2x( VectorSRegister d, Register a, Register b); inline void lxvd2x( VectorSRegister d, Register a, Register b);
inline void stxvd2x( VectorSRegister d, Register a, Register b); inline void stxvd2x( VectorSRegister d, Register a, Register b);
inline void mtvrd( VectorRegister d, Register a);
inline void mfvrd( Register a, VectorRegister d);
// AES (introduced with Power 8) // AES (introduced with Power 8)
inline void vcipher( VectorRegister d, VectorRegister a, VectorRegister b); inline void vcipher( VectorRegister d, VectorRegister a, VectorRegister b);

View file

@ -733,6 +733,8 @@ inline void Assembler::lvsr( VectorRegister d, Register s1, Register s2) { emit
// Vector-Scalar (VSX) instructions. // Vector-Scalar (VSX) instructions.
inline void Assembler::lxvd2x (VectorSRegister d, Register s1, Register s2) { emit_int32( LXVD2X_OPCODE | vsrt(d) | ra(s1) | rb(s2)); } inline void Assembler::lxvd2x (VectorSRegister d, Register s1, Register s2) { emit_int32( LXVD2X_OPCODE | vsrt(d) | ra(s1) | rb(s2)); }
inline void Assembler::stxvd2x(VectorSRegister d, Register s1, Register s2) { emit_int32( STXVD2X_OPCODE | vsrt(d) | ra(s1) | rb(s2)); } inline void Assembler::stxvd2x(VectorSRegister d, Register s1, Register s2) { emit_int32( STXVD2X_OPCODE | vsrt(d) | ra(s1) | rb(s2)); }
inline void Assembler::mtvrd( VectorRegister d, Register a) { emit_int32( MTVSRD_OPCODE | vrt(d) | ra(a) | 1u); } // 1u: d is treated as Vector (VMX/Altivec).
inline void Assembler::mfvrd( Register a, VectorRegister d) { emit_int32( MFVSRD_OPCODE | vrt(d) | ra(a) | 1u); } // 1u: d is treated as Vector (VMX/Altivec).
inline void Assembler::vpkpx( VectorRegister d, VectorRegister a, VectorRegister b) { emit_int32( VPKPX_OPCODE | vrt(d) | vra(a) | vrb(b)); } inline void Assembler::vpkpx( VectorRegister d, VectorRegister a, VectorRegister b) { emit_int32( VPKPX_OPCODE | vrt(d) | vra(a) | vrb(b)); }
inline void Assembler::vpkshss( VectorRegister d, VectorRegister a, VectorRegister b) { emit_int32( VPKSHSS_OPCODE | vrt(d) | vra(a) | vrb(b)); } inline void Assembler::vpkshss( VectorRegister d, VectorRegister a, VectorRegister b) { emit_int32( VPKSHSS_OPCODE | vrt(d) | vra(a) | vrb(b)); }

View file

@ -157,10 +157,11 @@ LIR_Opr LIRGenerator::safepoint_poll_register() {
LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index, LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index,
int shift, int disp, BasicType type) { int shift, int disp, BasicType type) {
assert(base->is_register(), "must be"); assert(base->is_register(), "must be");
intx large_disp = disp;
// Accumulate fixed displacements. // Accumulate fixed displacements.
if (index->is_constant()) { if (index->is_constant()) {
disp += index->as_constant_ptr()->as_jint() << shift; large_disp += (intx)(index->as_constant_ptr()->as_jint()) << shift;
index = LIR_OprFact::illegalOpr; index = LIR_OprFact::illegalOpr;
} }
@ -171,31 +172,31 @@ LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index,
__ shift_left(index, shift, tmp); __ shift_left(index, shift, tmp);
index = tmp; index = tmp;
} }
if (disp != 0) { if (large_disp != 0) {
LIR_Opr tmp = new_pointer_register(); LIR_Opr tmp = new_pointer_register();
if (Assembler::is_simm16(disp)) { if (Assembler::is_simm16(large_disp)) {
__ add(index, LIR_OprFact::intptrConst(disp), tmp); __ add(index, LIR_OprFact::intptrConst(large_disp), tmp);
index = tmp; index = tmp;
} else { } else {
__ move(LIR_OprFact::intptrConst(disp), tmp); __ move(LIR_OprFact::intptrConst(large_disp), tmp);
__ add(tmp, index, tmp); __ add(tmp, index, tmp);
index = tmp; index = tmp;
} }
disp = 0; large_disp = 0;
} }
} else if (!Assembler::is_simm16(disp)) { } else if (!Assembler::is_simm16(large_disp)) {
// Index is illegal so replace it with the displacement loaded into a register. // Index is illegal so replace it with the displacement loaded into a register.
index = new_pointer_register(); index = new_pointer_register();
__ move(LIR_OprFact::intptrConst(disp), index); __ move(LIR_OprFact::intptrConst(large_disp), index);
disp = 0; large_disp = 0;
} }
// At this point we either have base + index or base + displacement. // At this point we either have base + index or base + displacement.
if (disp == 0) { if (large_disp == 0) {
return new LIR_Address(base, index, type); return new LIR_Address(base, index, type);
} else { } else {
assert(Assembler::is_simm16(disp), "must be"); assert(Assembler::is_simm16(large_disp), "must be");
return new LIR_Address(base, disp, type); return new LIR_Address(base, large_disp, type);
} }
} }
@ -206,11 +207,11 @@ LIR_Address* LIRGenerator::emit_array_address(LIR_Opr array_opr, LIR_Opr index_o
int shift = exact_log2(elem_size); int shift = exact_log2(elem_size);
LIR_Opr base_opr; LIR_Opr base_opr;
int offset = arrayOopDesc::base_offset_in_bytes(type); intx offset = arrayOopDesc::base_offset_in_bytes(type);
if (index_opr->is_constant()) { if (index_opr->is_constant()) {
int i = index_opr->as_constant_ptr()->as_jint(); intx i = index_opr->as_constant_ptr()->as_jint();
int array_offset = i * elem_size; intx array_offset = i * elem_size;
if (Assembler::is_simm16(array_offset + offset)) { if (Assembler::is_simm16(array_offset + offset)) {
base_opr = array_opr; base_opr = array_opr;
offset = array_offset + offset; offset = array_offset + offset;
@ -1433,6 +1434,10 @@ void LIRGenerator::do_update_CRC32(Intrinsic* x) {
} }
} }
void LIRGenerator::do_FmaIntrinsic(Intrinsic* x) {
fatal("FMA intrinsic is not implemented on this platform");
}
void LIRGenerator::do_vectorizedMismatch(Intrinsic* x) { void LIRGenerator::do_vectorizedMismatch(Intrinsic* x) {
fatal("vectorizedMismatch intrinsic is not implemented on this platform"); fatal("vectorizedMismatch intrinsic is not implemented on this platform");
} }

View file

@ -4332,6 +4332,565 @@ void MacroAssembler::kernel_crc32_1byte(Register crc, Register buf, Register len
BLOCK_COMMENT("} kernel_crc32_1byte"); BLOCK_COMMENT("} kernel_crc32_1byte");
} }
/**
* @param crc register containing existing CRC (32-bit)
* @param buf register pointing to input byte buffer (byte*)
* @param len register containing number of bytes
* @param table register pointing to CRC table
* @param constants register pointing to CRC table for 128-bit aligned memory
* @param barretConstants register pointing to table for barrett reduction
* @param t0 volatile register
* @param t1 volatile register
* @param t2 volatile register
* @param t3 volatile register
*/
void MacroAssembler::kernel_crc32_1word_vpmsumd(Register crc, Register buf, Register len, Register table,
Register constants, Register barretConstants,
Register t0, Register t1, Register t2, Register t3, Register t4) {
assert_different_registers(crc, buf, len, table);
Label L_alignedHead, L_tail, L_alignTail, L_start, L_end;
Register prealign = t0;
Register postalign = t0;
BLOCK_COMMENT("kernel_crc32_1word_vpmsumb {");
// 1. use kernel_crc32_1word for shorter than 384bit
clrldi(len, len, 32);
cmpdi(CCR0, len, 384);
bge(CCR0, L_start);
Register tc0 = t4;
Register tc1 = constants;
Register tc2 = barretConstants;
kernel_crc32_1word(crc, buf, len, table,t0, t1, t2, t3, tc0, tc1, tc2, table);
b(L_end);
BIND(L_start);
// 2. ~c
nand(crc, crc, crc);
// 3. calculate from 0 to first 128bit-aligned address
clrldi_(prealign, buf, 57);
beq(CCR0, L_alignedHead);
subfic(prealign, prealign, 128);
subf(len, prealign, len);
update_byteLoop_crc32(crc, buf, prealign, table, t2, false, false);
// 4. calculate from first 128bit-aligned address to last 128bit-aligned address
BIND(L_alignedHead);
clrldi(postalign, len, 57);
subf(len, postalign, len);
// len must be more than 256bit
kernel_crc32_1word_aligned(crc, buf, len, constants, barretConstants, t1, t2, t3);
// 5. calculate remaining
cmpdi(CCR0, postalign, 0);
beq(CCR0, L_tail);
update_byteLoop_crc32(crc, buf, postalign, table, t2, false, false);
BIND(L_tail);
// 6. ~c
nand(crc, crc, crc);
BIND(L_end);
BLOCK_COMMENT("} kernel_crc32_1word_vpmsumb");
}
/**
* @param crc register containing existing CRC (32-bit)
* @param buf register pointing to input byte buffer (byte*)
* @param len register containing number of bytes
* @param constants register pointing to CRC table for 128-bit aligned memory
* @param barretConstants register pointing to table for barrett reduction
* @param t0 volatile register
* @param t1 volatile register
* @param t2 volatile register
*/
void MacroAssembler::kernel_crc32_1word_aligned(Register crc, Register buf, Register len,
Register constants, Register barretConstants, Register t0, Register t1, Register t2) {
Label L_mainLoop, L_tail, L_alignTail, L_barrett_reduction, L_end, L_first_warm_up_done, L_first_cool_down, L_second_cool_down, L_XOR, L_test;
Label L_lv0, L_lv1, L_lv2, L_lv3, L_lv4, L_lv5, L_lv6, L_lv7, L_lv8, L_lv9, L_lv10, L_lv11, L_lv12, L_lv13, L_lv14, L_lv15;
Label L_1, L_2, L_3, L_4;
Register rLoaded = t0;
Register rTmp1 = t1;
Register rTmp2 = t2;
Register off16 = R22;
Register off32 = R23;
Register off48 = R24;
Register off64 = R25;
Register off80 = R26;
Register off96 = R27;
Register off112 = R28;
Register rIdx = R29;
Register rMax = R30;
Register constantsPos = R31;
VectorRegister mask_32bit = VR24;
VectorRegister mask_64bit = VR25;
VectorRegister zeroes = VR26;
VectorRegister const1 = VR27;
VectorRegister const2 = VR28;
// Save non-volatile vector registers (frameless).
Register offset = t1; int offsetInt = 0;
offsetInt -= 16; li(offset, -16); stvx(VR20, offset, R1_SP);
offsetInt -= 16; addi(offset, offset, -16); stvx(VR21, offset, R1_SP);
offsetInt -= 16; addi(offset, offset, -16); stvx(VR22, offset, R1_SP);
offsetInt -= 16; addi(offset, offset, -16); stvx(VR23, offset, R1_SP);
offsetInt -= 16; addi(offset, offset, -16); stvx(VR24, offset, R1_SP);
offsetInt -= 16; addi(offset, offset, -16); stvx(VR25, offset, R1_SP);
offsetInt -= 16; addi(offset, offset, -16); stvx(VR26, offset, R1_SP);
offsetInt -= 16; addi(offset, offset, -16); stvx(VR27, offset, R1_SP);
offsetInt -= 16; addi(offset, offset, -16); stvx(VR28, offset, R1_SP);
offsetInt -= 8; std(R22, offsetInt, R1_SP);
offsetInt -= 8; std(R23, offsetInt, R1_SP);
offsetInt -= 8; std(R24, offsetInt, R1_SP);
offsetInt -= 8; std(R25, offsetInt, R1_SP);
offsetInt -= 8; std(R26, offsetInt, R1_SP);
offsetInt -= 8; std(R27, offsetInt, R1_SP);
offsetInt -= 8; std(R28, offsetInt, R1_SP);
offsetInt -= 8; std(R29, offsetInt, R1_SP);
offsetInt -= 8; std(R30, offsetInt, R1_SP);
offsetInt -= 8; std(R31, offsetInt, R1_SP);
// Set constants
li(off16, 16);
li(off32, 32);
li(off48, 48);
li(off64, 64);
li(off80, 80);
li(off96, 96);
li(off112, 112);
clrldi(crc, crc, 32);
vxor(zeroes, zeroes, zeroes);
vspltisw(VR0, -1);
vsldoi(mask_32bit, zeroes, VR0, 4);
vsldoi(mask_64bit, zeroes, VR0, -8);
// Get the initial value into v8
vxor(VR8, VR8, VR8);
mtvrd(VR8, crc);
vsldoi(VR8, zeroes, VR8, -8); // shift into bottom 32 bits
li (rLoaded, 0);
rldicr(rIdx, len, 0, 56);
{
BIND(L_1);
// Checksum in blocks of MAX_SIZE (32768)
lis(rMax, 0);
ori(rMax, rMax, 32768);
mr(rTmp2, rMax);
cmpd(CCR0, rIdx, rMax);
bgt(CCR0, L_2);
mr(rMax, rIdx);
BIND(L_2);
subf(rIdx, rMax, rIdx);
// our main loop does 128 bytes at a time
srdi(rMax, rMax, 7);
/*
* Work out the offset into the constants table to start at. Each
* constant is 16 bytes, and it is used against 128 bytes of input
* data - 128 / 16 = 8
*/
sldi(rTmp1, rMax, 4);
srdi(rTmp2, rTmp2, 3);
subf(rTmp1, rTmp1, rTmp2);
// We reduce our final 128 bytes in a separate step
addi(rMax, rMax, -1);
mtctr(rMax);
// Find the start of our constants
add(constantsPos, constants, rTmp1);
// zero VR0-v7 which will contain our checksums
vxor(VR0, VR0, VR0);
vxor(VR1, VR1, VR1);
vxor(VR2, VR2, VR2);
vxor(VR3, VR3, VR3);
vxor(VR4, VR4, VR4);
vxor(VR5, VR5, VR5);
vxor(VR6, VR6, VR6);
vxor(VR7, VR7, VR7);
lvx(const1, constantsPos);
/*
* If we are looping back to consume more data we use the values
* already in VR16-v23.
*/
cmpdi(CCR0, rLoaded, 1);
beq(CCR0, L_3);
{
// First warm up pass
lvx(VR16, buf);
lvx(VR17, off16, buf);
lvx(VR18, off32, buf);
lvx(VR19, off48, buf);
lvx(VR20, off64, buf);
lvx(VR21, off80, buf);
lvx(VR22, off96, buf);
lvx(VR23, off112, buf);
addi(buf, buf, 8*16);
// xor in initial value
vxor(VR16, VR16, VR8);
}
BIND(L_3);
bdz(L_first_warm_up_done);
addi(constantsPos, constantsPos, 16);
lvx(const2, constantsPos);
// Second warm up pass
vpmsumd(VR8, VR16, const1);
lvx(VR16, buf);
vpmsumd(VR9, VR17, const1);
lvx(VR17, off16, buf);
vpmsumd(VR10, VR18, const1);
lvx(VR18, off32, buf);
vpmsumd(VR11, VR19, const1);
lvx(VR19, off48, buf);
vpmsumd(VR12, VR20, const1);
lvx(VR20, off64, buf);
vpmsumd(VR13, VR21, const1);
lvx(VR21, off80, buf);
vpmsumd(VR14, VR22, const1);
lvx(VR22, off96, buf);
vpmsumd(VR15, VR23, const1);
lvx(VR23, off112, buf);
addi(buf, buf, 8 * 16);
bdz(L_first_cool_down);
/*
* main loop. We modulo schedule it such that it takes three iterations
* to complete - first iteration load, second iteration vpmsum, third
* iteration xor.
*/
{
BIND(L_4);
lvx(const1, constantsPos); addi(constantsPos, constantsPos, 16);
vxor(VR0, VR0, VR8);
vpmsumd(VR8, VR16, const2);
lvx(VR16, buf);
vxor(VR1, VR1, VR9);
vpmsumd(VR9, VR17, const2);
lvx(VR17, off16, buf);
vxor(VR2, VR2, VR10);
vpmsumd(VR10, VR18, const2);
lvx(VR18, off32, buf);
vxor(VR3, VR3, VR11);
vpmsumd(VR11, VR19, const2);
lvx(VR19, off48, buf);
lvx(const2, constantsPos);
vxor(VR4, VR4, VR12);
vpmsumd(VR12, VR20, const1);
lvx(VR20, off64, buf);
vxor(VR5, VR5, VR13);
vpmsumd(VR13, VR21, const1);
lvx(VR21, off80, buf);
vxor(VR6, VR6, VR14);
vpmsumd(VR14, VR22, const1);
lvx(VR22, off96, buf);
vxor(VR7, VR7, VR15);
vpmsumd(VR15, VR23, const1);
lvx(VR23, off112, buf);
addi(buf, buf, 8 * 16);
bdnz(L_4);
}
BIND(L_first_cool_down);
// First cool down pass
lvx(const1, constantsPos);
addi(constantsPos, constantsPos, 16);
vxor(VR0, VR0, VR8);
vpmsumd(VR8, VR16, const1);
vxor(VR1, VR1, VR9);
vpmsumd(VR9, VR17, const1);
vxor(VR2, VR2, VR10);
vpmsumd(VR10, VR18, const1);
vxor(VR3, VR3, VR11);
vpmsumd(VR11, VR19, const1);
vxor(VR4, VR4, VR12);
vpmsumd(VR12, VR20, const1);
vxor(VR5, VR5, VR13);
vpmsumd(VR13, VR21, const1);
vxor(VR6, VR6, VR14);
vpmsumd(VR14, VR22, const1);
vxor(VR7, VR7, VR15);
vpmsumd(VR15, VR23, const1);
BIND(L_second_cool_down);
// Second cool down pass
vxor(VR0, VR0, VR8);
vxor(VR1, VR1, VR9);
vxor(VR2, VR2, VR10);
vxor(VR3, VR3, VR11);
vxor(VR4, VR4, VR12);
vxor(VR5, VR5, VR13);
vxor(VR6, VR6, VR14);
vxor(VR7, VR7, VR15);
/*
* vpmsumd produces a 96 bit result in the least significant bits
* of the register. Since we are bit reflected we have to shift it
* left 32 bits so it occupies the least significant bits in the
* bit reflected domain.
*/
vsldoi(VR0, VR0, zeroes, 4);
vsldoi(VR1, VR1, zeroes, 4);
vsldoi(VR2, VR2, zeroes, 4);
vsldoi(VR3, VR3, zeroes, 4);
vsldoi(VR4, VR4, zeroes, 4);
vsldoi(VR5, VR5, zeroes, 4);
vsldoi(VR6, VR6, zeroes, 4);
vsldoi(VR7, VR7, zeroes, 4);
// xor with last 1024 bits
lvx(VR8, buf);
lvx(VR9, off16, buf);
lvx(VR10, off32, buf);
lvx(VR11, off48, buf);
lvx(VR12, off64, buf);
lvx(VR13, off80, buf);
lvx(VR14, off96, buf);
lvx(VR15, off112, buf);
addi(buf, buf, 8 * 16);
vxor(VR16, VR0, VR8);
vxor(VR17, VR1, VR9);
vxor(VR18, VR2, VR10);
vxor(VR19, VR3, VR11);
vxor(VR20, VR4, VR12);
vxor(VR21, VR5, VR13);
vxor(VR22, VR6, VR14);
vxor(VR23, VR7, VR15);
li(rLoaded, 1);
cmpdi(CCR0, rIdx, 0);
addi(rIdx, rIdx, 128);
bne(CCR0, L_1);
}
// Work out how many bytes we have left
andi_(len, len, 127);
// Calculate where in the constant table we need to start
subfic(rTmp1, len, 128);
add(constantsPos, constantsPos, rTmp1);
// How many 16 byte chunks are in the tail
srdi(rIdx, len, 4);
mtctr(rIdx);
/*
* Reduce the previously calculated 1024 bits to 64 bits, shifting
* 32 bits to include the trailing 32 bits of zeros
*/
lvx(VR0, constantsPos);
lvx(VR1, off16, constantsPos);
lvx(VR2, off32, constantsPos);
lvx(VR3, off48, constantsPos);
lvx(VR4, off64, constantsPos);
lvx(VR5, off80, constantsPos);
lvx(VR6, off96, constantsPos);
lvx(VR7, off112, constantsPos);
addi(constantsPos, constantsPos, 8 * 16);
vpmsumw(VR0, VR16, VR0);
vpmsumw(VR1, VR17, VR1);
vpmsumw(VR2, VR18, VR2);
vpmsumw(VR3, VR19, VR3);
vpmsumw(VR4, VR20, VR4);
vpmsumw(VR5, VR21, VR5);
vpmsumw(VR6, VR22, VR6);
vpmsumw(VR7, VR23, VR7);
// Now reduce the tail (0 - 112 bytes)
cmpdi(CCR0, rIdx, 0);
beq(CCR0, L_XOR);
lvx(VR16, buf); addi(buf, buf, 16);
lvx(VR17, constantsPos);
vpmsumw(VR16, VR16, VR17);
vxor(VR0, VR0, VR16);
beq(CCR0, L_XOR);
lvx(VR16, buf); addi(buf, buf, 16);
lvx(VR17, off16, constantsPos);
vpmsumw(VR16, VR16, VR17);
vxor(VR0, VR0, VR16);
beq(CCR0, L_XOR);
lvx(VR16, buf); addi(buf, buf, 16);
lvx(VR17, off32, constantsPos);
vpmsumw(VR16, VR16, VR17);
vxor(VR0, VR0, VR16);
beq(CCR0, L_XOR);
lvx(VR16, buf); addi(buf, buf, 16);
lvx(VR17, off48,constantsPos);
vpmsumw(VR16, VR16, VR17);
vxor(VR0, VR0, VR16);
beq(CCR0, L_XOR);
lvx(VR16, buf); addi(buf, buf, 16);
lvx(VR17, off64, constantsPos);
vpmsumw(VR16, VR16, VR17);
vxor(VR0, VR0, VR16);
beq(CCR0, L_XOR);
lvx(VR16, buf); addi(buf, buf, 16);
lvx(VR17, off80, constantsPos);
vpmsumw(VR16, VR16, VR17);
vxor(VR0, VR0, VR16);
beq(CCR0, L_XOR);
lvx(VR16, buf); addi(buf, buf, 16);
lvx(VR17, off96, constantsPos);
vpmsumw(VR16, VR16, VR17);
vxor(VR0, VR0, VR16);
// Now xor all the parallel chunks together
BIND(L_XOR);
vxor(VR0, VR0, VR1);
vxor(VR2, VR2, VR3);
vxor(VR4, VR4, VR5);
vxor(VR6, VR6, VR7);
vxor(VR0, VR0, VR2);
vxor(VR4, VR4, VR6);
vxor(VR0, VR0, VR4);
b(L_barrett_reduction);
BIND(L_first_warm_up_done);
lvx(const1, constantsPos);
addi(constantsPos, constantsPos, 16);
vpmsumd(VR8, VR16, const1);
vpmsumd(VR9, VR17, const1);
vpmsumd(VR10, VR18, const1);
vpmsumd(VR11, VR19, const1);
vpmsumd(VR12, VR20, const1);
vpmsumd(VR13, VR21, const1);
vpmsumd(VR14, VR22, const1);
vpmsumd(VR15, VR23, const1);
b(L_second_cool_down);
BIND(L_barrett_reduction);
lvx(const1, barretConstants);
addi(barretConstants, barretConstants, 16);
lvx(const2, barretConstants);
vsldoi(VR1, VR0, VR0, -8);
vxor(VR0, VR0, VR1); // xor two 64 bit results together
// shift left one bit
vspltisb(VR1, 1);
vsl(VR0, VR0, VR1);
vand(VR0, VR0, mask_64bit);
/*
* The reflected version of Barrett reduction. Instead of bit
* reflecting our data (which is expensive to do), we bit reflect our
* constants and our algorithm, which means the intermediate data in
* our vector registers goes from 0-63 instead of 63-0. We can reflect
* the algorithm because we don't carry in mod 2 arithmetic.
*/
vand(VR1, VR0, mask_32bit); // bottom 32 bits of a
vpmsumd(VR1, VR1, const1); // ma
vand(VR1, VR1, mask_32bit); // bottom 32bits of ma
vpmsumd(VR1, VR1, const2); // qn */
vxor(VR0, VR0, VR1); // a - qn, subtraction is xor in GF(2)
/*
* Since we are bit reflected, the result (ie the low 32 bits) is in
* the high 32 bits. We just need to shift it left 4 bytes
* V0 [ 0 1 X 3 ]
* V0 [ 0 X 2 3 ]
*/
vsldoi(VR0, VR0, zeroes, 4); // shift result into top 64 bits of
// Get it into r3
mfvrd(crc, VR0);
BIND(L_end);
offsetInt = 0;
// Restore non-volatile Vector registers (frameless).
offsetInt -= 16; li(offset, -16); lvx(VR20, offset, R1_SP);
offsetInt -= 16; addi(offset, offset, -16); lvx(VR21, offset, R1_SP);
offsetInt -= 16; addi(offset, offset, -16); lvx(VR22, offset, R1_SP);
offsetInt -= 16; addi(offset, offset, -16); lvx(VR23, offset, R1_SP);
offsetInt -= 16; addi(offset, offset, -16); lvx(VR24, offset, R1_SP);
offsetInt -= 16; addi(offset, offset, -16); lvx(VR25, offset, R1_SP);
offsetInt -= 16; addi(offset, offset, -16); lvx(VR26, offset, R1_SP);
offsetInt -= 16; addi(offset, offset, -16); lvx(VR27, offset, R1_SP);
offsetInt -= 16; addi(offset, offset, -16); lvx(VR28, offset, R1_SP);
offsetInt -= 8; ld(R22, offsetInt, R1_SP);
offsetInt -= 8; ld(R23, offsetInt, R1_SP);
offsetInt -= 8; ld(R24, offsetInt, R1_SP);
offsetInt -= 8; ld(R25, offsetInt, R1_SP);
offsetInt -= 8; ld(R26, offsetInt, R1_SP);
offsetInt -= 8; ld(R27, offsetInt, R1_SP);
offsetInt -= 8; ld(R28, offsetInt, R1_SP);
offsetInt -= 8; ld(R29, offsetInt, R1_SP);
offsetInt -= 8; ld(R30, offsetInt, R1_SP);
offsetInt -= 8; ld(R31, offsetInt, R1_SP);
}
void MacroAssembler::kernel_crc32_singleByte(Register crc, Register buf, Register len, Register table, Register tmp) { void MacroAssembler::kernel_crc32_singleByte(Register crc, Register buf, Register len, Register table, Register tmp) {
assert_different_registers(crc, buf, /* len, not used!! */ table, tmp); assert_different_registers(crc, buf, /* len, not used!! */ table, tmp);

View file

@ -834,6 +834,13 @@ class MacroAssembler: public Assembler {
Register tc0, Register tc1, Register tc2, Register tc3); Register tc0, Register tc1, Register tc2, Register tc3);
void kernel_crc32_1byte(Register crc, Register buf, Register len, Register table, void kernel_crc32_1byte(Register crc, Register buf, Register len, Register table,
Register t0, Register t1, Register t2, Register t3); Register t0, Register t1, Register t2, Register t3);
void kernel_crc32_1word_vpmsumd(Register crc, Register buf, Register len, Register table,
Register constants, Register barretConstants,
Register t0, Register t1, Register t2, Register t3, Register t4);
void kernel_crc32_1word_aligned(Register crc, Register buf, Register len,
Register constants, Register barretConstants,
Register t0, Register t1, Register t2);
void kernel_crc32_singleByte(Register crc, Register buf, Register len, Register table, Register tmp); void kernel_crc32_singleByte(Register crc, Register buf, Register len, Register table, Register tmp);
// //

View file

@ -3205,8 +3205,37 @@ class StubGenerator: public StubCodeGenerator {
const Register crc = R3_ARG1; // Current checksum, preset by caller or result from previous call. const Register crc = R3_ARG1; // Current checksum, preset by caller or result from previous call.
const Register data = R4_ARG2; // source byte array const Register data = R4_ARG2; // source byte array
const Register dataLen = R5_ARG3; // #bytes to process const Register dataLen = R5_ARG3; // #bytes to process
const Register table = R6_ARG4; // crc table address
const Register table = R6; // crc table address
#ifdef VM_LITTLE_ENDIAN
if (VM_Version::has_vpmsumb()) {
const Register constants = R2; // constants address
const Register bconstants = R8; // barret table address
const Register t0 = R9;
const Register t1 = R10;
const Register t2 = R11;
const Register t3 = R12;
const Register t4 = R7;
BLOCK_COMMENT("Stub body {");
assert_different_registers(crc, data, dataLen, table);
StubRoutines::ppc64::generate_load_crc_table_addr(_masm, table);
StubRoutines::ppc64::generate_load_crc_constants_addr(_masm, constants);
StubRoutines::ppc64::generate_load_crc_barret_constants_addr(_masm, bconstants);
__ kernel_crc32_1word_vpmsumd(crc, data, dataLen, table, constants, bconstants, t0, t1, t2, t3, t4);
BLOCK_COMMENT("return");
__ mr_if_needed(R3_RET, crc); // Updated crc is function result. No copying required (R3_ARG1 == R3_RET).
__ blr();
BLOCK_COMMENT("} Stub body");
} else
#endif
{
const Register t0 = R2; const Register t0 = R2;
const Register t1 = R7; const Register t1 = R7;
const Register t2 = R8; const Register t2 = R8;
@ -3227,6 +3256,8 @@ class StubGenerator: public StubCodeGenerator {
__ blr(); __ blr();
BLOCK_COMMENT("} Stub body"); BLOCK_COMMENT("} Stub body");
}
return start; return start;
} }

View file

@ -45,6 +45,8 @@ enum platform_dependent_constants {
#else #else
#define CRC32_TABLES 1 #define CRC32_TABLES 1
#endif #endif
#define CRC32_CONSTANTS_SIZE 1084
#define CRC32_BARRET_CONSTANTS 10
class ppc64 { class ppc64 {
friend class StubGenerator; friend class StubGenerator;
@ -53,11 +55,17 @@ class ppc64 {
// CRC32 Intrinsics. // CRC32 Intrinsics.
static juint _crc_table[CRC32_TABLES][CRC32_COLUMN_SIZE]; static juint _crc_table[CRC32_TABLES][CRC32_COLUMN_SIZE];
static juint* _constants;
static juint* _barret_constants;
public: public:
// CRC32 Intrinsics. // CRC32 Intrinsics.
static void generate_load_crc_table_addr(MacroAssembler* masm, Register table); static void generate_load_crc_table_addr(MacroAssembler* masm, Register table);
static void generate_load_crc_constants_addr(MacroAssembler* masm, Register table);
static void generate_load_crc_barret_constants_addr(MacroAssembler* masm, Register table);
static juint* generate_crc_constants();
static juint* generate_crc_barret_constants();
}; };

View file

@ -37,6 +37,311 @@ void StubRoutines::ppc64::generate_load_crc_table_addr(MacroAssembler* masm, Reg
__ load_const_optimized(table, StubRoutines::_crc_table_adr, R0); __ load_const_optimized(table, StubRoutines::_crc_table_adr, R0);
} }
void StubRoutines::ppc64::generate_load_crc_constants_addr(MacroAssembler* masm, Register table) {
__ load_const_optimized(table, (address)StubRoutines::ppc64::_constants, R0);
}
void StubRoutines::ppc64::generate_load_crc_barret_constants_addr(MacroAssembler* masm, Register table) {
__ load_const_optimized(table, (address)StubRoutines::ppc64::_barret_constants, R0);
}
juint* StubRoutines::ppc64::generate_crc_constants() {
juint constants[CRC32_CONSTANTS_SIZE] = {
// Reduce 262144 kbits to 1024 bits
0x99ea94a8UL, 0x00000000UL, 0x651797d2UL, 0x00000001UL, // x^261120 mod p(x)` << 1, x^261184 mod p(x)` << 1
0x945a8420UL, 0x00000000UL, 0x21e0d56cUL, 0x00000000UL, // x^260096 mod p(x)` << 1, x^260160 mod p(x)` << 1
0x30762706UL, 0x00000000UL, 0x0f95ecaaUL, 0x00000000UL, // x^259072 mod p(x)` << 1, x^259136 mod p(x)` << 1
0xa52fc582UL, 0x00000001UL, 0xebd224acUL, 0x00000001UL, // x^258048 mod p(x)` << 1, x^258112 mod p(x)` << 1
0xa4a7167aUL, 0x00000001UL, 0x0ccb97caUL, 0x00000000UL, // x^257024 mod p(x)` << 1, x^257088 mod p(x)` << 1
0x0c18249aUL, 0x00000000UL, 0x006ec8a8UL, 0x00000001UL, // x^256000 mod p(x)` << 1, x^256064 mod p(x)` << 1
0xa924ae7cUL, 0x00000000UL, 0x4f58f196UL, 0x00000001UL, // x^254976 mod p(x)` << 1, x^255040 mod p(x)` << 1
0xe12ccc12UL, 0x00000001UL, 0xa7192ca6UL, 0x00000001UL, // x^253952 mod p(x)` << 1, x^254016 mod p(x)` << 1
0xa0b9d4acUL, 0x00000000UL, 0x9a64bab2UL, 0x00000001UL, // x^252928 mod p(x)` << 1, x^252992 mod p(x)` << 1
0x95e8ddfeUL, 0x00000000UL, 0x14f4ed2eUL, 0x00000000UL, // x^251904 mod p(x)` << 1, x^251968 mod p(x)` << 1
0x233fddc4UL, 0x00000000UL, 0x1092b6a2UL, 0x00000001UL, // x^250880 mod p(x)` << 1, x^250944 mod p(x)` << 1
0xb4529b62UL, 0x00000001UL, 0xc8a1629cUL, 0x00000000UL, // x^249856 mod p(x)` << 1, x^249920 mod p(x)` << 1
0xa7fa0e64UL, 0x00000001UL, 0x7bf32e8eUL, 0x00000001UL, // x^248832 mod p(x)` << 1, x^248896 mod p(x)` << 1
0xb5334592UL, 0x00000001UL, 0xf8cc6582UL, 0x00000001UL, // x^247808 mod p(x)` << 1, x^247872 mod p(x)` << 1
0x1f8ee1b4UL, 0x00000001UL, 0x8631ddf0UL, 0x00000000UL, // x^246784 mod p(x)` << 1, x^246848 mod p(x)` << 1
0x6252e632UL, 0x00000000UL, 0x7e5a76d0UL, 0x00000000UL, // x^245760 mod p(x)` << 1, x^245824 mod p(x)` << 1
0xab973e84UL, 0x00000000UL, 0x2b09b31cUL, 0x00000000UL, // x^244736 mod p(x)` << 1, x^244800 mod p(x)` << 1
0x7734f5ecUL, 0x00000000UL, 0xb2df1f84UL, 0x00000001UL, // x^243712 mod p(x)` << 1, x^243776 mod p(x)` << 1
0x7c547798UL, 0x00000000UL, 0xd6f56afcUL, 0x00000001UL, // x^242688 mod p(x)` << 1, x^242752 mod p(x)` << 1
0x7ec40210UL, 0x00000000UL, 0xb9b5e70cUL, 0x00000001UL, // x^241664 mod p(x)` << 1, x^241728 mod p(x)` << 1
0xab1695a8UL, 0x00000001UL, 0x34b626d2UL, 0x00000000UL, // x^240640 mod p(x)` << 1, x^240704 mod p(x)` << 1
0x90494bbaUL, 0x00000000UL, 0x4c53479aUL, 0x00000001UL, // x^239616 mod p(x)` << 1, x^239680 mod p(x)` << 1
0x123fb816UL, 0x00000001UL, 0xa6d179a4UL, 0x00000001UL, // x^238592 mod p(x)` << 1, x^238656 mod p(x)` << 1
0xe188c74cUL, 0x00000001UL, 0x5abd16b4UL, 0x00000001UL, // x^237568 mod p(x)` << 1, x^237632 mod p(x)` << 1
0xc2d3451cUL, 0x00000001UL, 0x018f9852UL, 0x00000000UL, // x^236544 mod p(x)` << 1, x^236608 mod p(x)` << 1
0xf55cf1caUL, 0x00000000UL, 0x1fb3084aUL, 0x00000000UL, // x^235520 mod p(x)` << 1, x^235584 mod p(x)` << 1
0xa0531540UL, 0x00000001UL, 0xc53dfb04UL, 0x00000000UL, // x^234496 mod p(x)` << 1, x^234560 mod p(x)` << 1
0x32cd7ebcUL, 0x00000001UL, 0xe10c9ad6UL, 0x00000000UL, // x^233472 mod p(x)` << 1, x^233536 mod p(x)` << 1
0x73ab7f36UL, 0x00000000UL, 0x25aa994aUL, 0x00000000UL, // x^232448 mod p(x)` << 1, x^232512 mod p(x)` << 1
0x41aed1c2UL, 0x00000000UL, 0xfa3a74c4UL, 0x00000000UL, // x^231424 mod p(x)` << 1, x^231488 mod p(x)` << 1
0x36c53800UL, 0x00000001UL, 0x33eb3f40UL, 0x00000000UL, // x^230400 mod p(x)` << 1, x^230464 mod p(x)` << 1
0x26835a30UL, 0x00000001UL, 0x7193f296UL, 0x00000001UL, // x^229376 mod p(x)` << 1, x^229440 mod p(x)` << 1
0x6241b502UL, 0x00000000UL, 0x43f6c86aUL, 0x00000000UL, // x^228352 mod p(x)` << 1, x^228416 mod p(x)` << 1
0xd5196ad4UL, 0x00000000UL, 0x6b513ec6UL, 0x00000001UL, // x^227328 mod p(x)` << 1, x^227392 mod p(x)` << 1
0x9cfa769aUL, 0x00000000UL, 0xc8f25b4eUL, 0x00000000UL, // x^226304 mod p(x)` << 1, x^226368 mod p(x)` << 1
0x920e5df4UL, 0x00000000UL, 0xa45048ecUL, 0x00000001UL, // x^225280 mod p(x)` << 1, x^225344 mod p(x)` << 1
0x69dc310eUL, 0x00000001UL, 0x0c441004UL, 0x00000000UL, // x^224256 mod p(x)` << 1, x^224320 mod p(x)` << 1
0x09fc331cUL, 0x00000000UL, 0x0e17cad6UL, 0x00000000UL, // x^223232 mod p(x)` << 1, x^223296 mod p(x)` << 1
0x0d94a81eUL, 0x00000001UL, 0x253ae964UL, 0x00000001UL, // x^222208 mod p(x)` << 1, x^222272 mod p(x)` << 1
0x27a20ab2UL, 0x00000000UL, 0xd7c88ebcUL, 0x00000001UL, // x^221184 mod p(x)` << 1, x^221248 mod p(x)` << 1
0x14f87504UL, 0x00000001UL, 0xe7ca913aUL, 0x00000001UL, // x^220160 mod p(x)` << 1, x^220224 mod p(x)` << 1
0x4b076d96UL, 0x00000000UL, 0x33ed078aUL, 0x00000000UL, // x^219136 mod p(x)` << 1, x^219200 mod p(x)` << 1
0xda4d1e74UL, 0x00000000UL, 0xe1839c78UL, 0x00000000UL, // x^218112 mod p(x)` << 1, x^218176 mod p(x)` << 1
0x1b81f672UL, 0x00000000UL, 0x322b267eUL, 0x00000001UL, // x^217088 mod p(x)` << 1, x^217152 mod p(x)` << 1
0x9367c988UL, 0x00000000UL, 0x638231b6UL, 0x00000000UL, // x^216064 mod p(x)` << 1, x^216128 mod p(x)` << 1
0x717214caUL, 0x00000001UL, 0xee7f16f4UL, 0x00000001UL, // x^215040 mod p(x)` << 1, x^215104 mod p(x)` << 1
0x9f47d820UL, 0x00000000UL, 0x17d9924aUL, 0x00000001UL, // x^214016 mod p(x)` << 1, x^214080 mod p(x)` << 1
0x0d9a47d2UL, 0x00000001UL, 0xe1a9e0c4UL, 0x00000000UL, // x^212992 mod p(x)` << 1, x^213056 mod p(x)` << 1
0xa696c58cUL, 0x00000000UL, 0x403731dcUL, 0x00000001UL, // x^211968 mod p(x)` << 1, x^212032 mod p(x)` << 1
0x2aa28ec6UL, 0x00000000UL, 0xa5ea9682UL, 0x00000001UL, // x^210944 mod p(x)` << 1, x^211008 mod p(x)` << 1
0xfe18fd9aUL, 0x00000001UL, 0x01c5c578UL, 0x00000001UL, // x^209920 mod p(x)` << 1, x^209984 mod p(x)` << 1
0x9d4fc1aeUL, 0x00000001UL, 0xdddf6494UL, 0x00000000UL, // x^208896 mod p(x)` << 1, x^208960 mod p(x)` << 1
0xba0e3deaUL, 0x00000001UL, 0xf1c3db28UL, 0x00000000UL, // x^207872 mod p(x)` << 1, x^207936 mod p(x)` << 1
0x74b59a5eUL, 0x00000000UL, 0x3112fb9cUL, 0x00000001UL, // x^206848 mod p(x)` << 1, x^206912 mod p(x)` << 1
0xf2b5ea98UL, 0x00000000UL, 0xb680b906UL, 0x00000000UL, // x^205824 mod p(x)` << 1, x^205888 mod p(x)` << 1
0x87132676UL, 0x00000001UL, 0x1a282932UL, 0x00000000UL, // x^204800 mod p(x)` << 1, x^204864 mod p(x)` << 1
0x0a8c6ad4UL, 0x00000001UL, 0x89406e7eUL, 0x00000000UL, // x^203776 mod p(x)` << 1, x^203840 mod p(x)` << 1
0xe21dfe70UL, 0x00000001UL, 0xdef6be8cUL, 0x00000001UL, // x^202752 mod p(x)` << 1, x^202816 mod p(x)` << 1
0xda0050e4UL, 0x00000001UL, 0x75258728UL, 0x00000000UL, // x^201728 mod p(x)` << 1, x^201792 mod p(x)` << 1
0x772172aeUL, 0x00000000UL, 0x9536090aUL, 0x00000001UL, // x^200704 mod p(x)` << 1, x^200768 mod p(x)` << 1
0xe47724aaUL, 0x00000000UL, 0xf2455bfcUL, 0x00000000UL, // x^199680 mod p(x)` << 1, x^199744 mod p(x)` << 1
0x3cd63ac4UL, 0x00000000UL, 0x8c40baf4UL, 0x00000001UL, // x^198656 mod p(x)` << 1, x^198720 mod p(x)` << 1
0xbf47d352UL, 0x00000001UL, 0x4cd390d4UL, 0x00000000UL, // x^197632 mod p(x)` << 1, x^197696 mod p(x)` << 1
0x8dc1d708UL, 0x00000001UL, 0xe4ece95aUL, 0x00000001UL, // x^196608 mod p(x)` << 1, x^196672 mod p(x)` << 1
0x2d4620a4UL, 0x00000000UL, 0x1a3ee918UL, 0x00000000UL, // x^195584 mod p(x)` << 1, x^195648 mod p(x)` << 1
0x58fd1740UL, 0x00000000UL, 0x7c652fb8UL, 0x00000000UL, // x^194560 mod p(x)` << 1, x^194624 mod p(x)` << 1
0xdadd9bfcUL, 0x00000000UL, 0x1c67842cUL, 0x00000001UL, // x^193536 mod p(x)` << 1, x^193600 mod p(x)` << 1
0xea2140beUL, 0x00000001UL, 0x254f759cUL, 0x00000000UL, // x^192512 mod p(x)` << 1, x^192576 mod p(x)` << 1
0x9de128baUL, 0x00000000UL, 0x7ece94caUL, 0x00000000UL, // x^191488 mod p(x)` << 1, x^191552 mod p(x)` << 1
0x3ac3aa8eUL, 0x00000001UL, 0x38f258c2UL, 0x00000000UL, // x^190464 mod p(x)` << 1, x^190528 mod p(x)` << 1
0x99980562UL, 0x00000000UL, 0xcdf17b00UL, 0x00000001UL, // x^189440 mod p(x)` << 1, x^189504 mod p(x)` << 1
0xc1579c86UL, 0x00000001UL, 0x1f882c16UL, 0x00000001UL, // x^188416 mod p(x)` << 1, x^188480 mod p(x)` << 1
0x68dbbf94UL, 0x00000000UL, 0x00093fc8UL, 0x00000001UL, // x^187392 mod p(x)` << 1, x^187456 mod p(x)` << 1
0x4509fb04UL, 0x00000000UL, 0xcd684f16UL, 0x00000001UL, // x^186368 mod p(x)` << 1, x^186432 mod p(x)` << 1
0x202f6398UL, 0x00000001UL, 0x4bc6a70aUL, 0x00000000UL, // x^185344 mod p(x)` << 1, x^185408 mod p(x)` << 1
0x3aea243eUL, 0x00000001UL, 0x4fc7e8e4UL, 0x00000000UL, // x^184320 mod p(x)` << 1, x^184384 mod p(x)` << 1
0xb4052ae6UL, 0x00000001UL, 0x30103f1cUL, 0x00000001UL, // x^183296 mod p(x)` << 1, x^183360 mod p(x)` << 1
0xcd2a0ae8UL, 0x00000001UL, 0x11b0024cUL, 0x00000001UL, // x^182272 mod p(x)` << 1, x^182336 mod p(x)` << 1
0xfe4aa8b4UL, 0x00000001UL, 0x0b3079daUL, 0x00000001UL, // x^181248 mod p(x)` << 1, x^181312 mod p(x)` << 1
0xd1559a42UL, 0x00000001UL, 0x0192bcc2UL, 0x00000001UL, // x^180224 mod p(x)` << 1, x^180288 mod p(x)` << 1
0xf3e05eccUL, 0x00000001UL, 0x74838d50UL, 0x00000000UL, // x^179200 mod p(x)` << 1, x^179264 mod p(x)` << 1
0x04ddd2ccUL, 0x00000001UL, 0x1b20f520UL, 0x00000000UL, // x^178176 mod p(x)` << 1, x^178240 mod p(x)` << 1
0x5393153cUL, 0x00000001UL, 0x50c3590aUL, 0x00000000UL, // x^177152 mod p(x)` << 1, x^177216 mod p(x)` << 1
0x57e942c6UL, 0x00000000UL, 0xb41cac8eUL, 0x00000000UL, // x^176128 mod p(x)` << 1, x^176192 mod p(x)` << 1
0x2c633850UL, 0x00000001UL, 0x0c72cc78UL, 0x00000000UL, // x^175104 mod p(x)` << 1, x^175168 mod p(x)` << 1
0xebcaae4cUL, 0x00000000UL, 0x30cdb032UL, 0x00000000UL, // x^174080 mod p(x)` << 1, x^174144 mod p(x)` << 1
0x3ee532a6UL, 0x00000001UL, 0x3e09fc32UL, 0x00000001UL, // x^173056 mod p(x)` << 1, x^173120 mod p(x)` << 1
0xbf0cbc7eUL, 0x00000001UL, 0x1ed624d2UL, 0x00000000UL, // x^172032 mod p(x)` << 1, x^172096 mod p(x)` << 1
0xd50b7a5aUL, 0x00000000UL, 0x781aee1aUL, 0x00000000UL, // x^171008 mod p(x)` << 1, x^171072 mod p(x)` << 1
0x02fca6e8UL, 0x00000000UL, 0xc4d8348cUL, 0x00000001UL, // x^169984 mod p(x)` << 1, x^170048 mod p(x)` << 1
0x7af40044UL, 0x00000000UL, 0x57a40336UL, 0x00000000UL, // x^168960 mod p(x)` << 1, x^169024 mod p(x)` << 1
0x16178744UL, 0x00000000UL, 0x85544940UL, 0x00000000UL, // x^167936 mod p(x)` << 1, x^168000 mod p(x)` << 1
0x4c177458UL, 0x00000001UL, 0x9cd21e80UL, 0x00000001UL, // x^166912 mod p(x)` << 1, x^166976 mod p(x)` << 1
0x1b6ddf04UL, 0x00000001UL, 0x3eb95bc0UL, 0x00000001UL, // x^165888 mod p(x)` << 1, x^165952 mod p(x)` << 1
0xf3e29cccUL, 0x00000001UL, 0xdfc9fdfcUL, 0x00000001UL, // x^164864 mod p(x)` << 1, x^164928 mod p(x)` << 1
0x35ae7562UL, 0x00000001UL, 0xcd028bc2UL, 0x00000000UL, // x^163840 mod p(x)` << 1, x^163904 mod p(x)` << 1
0x90ef812cUL, 0x00000001UL, 0x90db8c44UL, 0x00000000UL, // x^162816 mod p(x)` << 1, x^162880 mod p(x)` << 1
0x67a2c786UL, 0x00000000UL, 0x0010a4ceUL, 0x00000001UL, // x^161792 mod p(x)` << 1, x^161856 mod p(x)` << 1
0x48b9496cUL, 0x00000000UL, 0xc8f4c72cUL, 0x00000001UL, // x^160768 mod p(x)` << 1, x^160832 mod p(x)` << 1
0x5a422de6UL, 0x00000001UL, 0x1c26170cUL, 0x00000000UL, // x^159744 mod p(x)` << 1, x^159808 mod p(x)` << 1
0xef0e3640UL, 0x00000001UL, 0xe3fccf68UL, 0x00000000UL, // x^158720 mod p(x)` << 1, x^158784 mod p(x)` << 1
0x006d2d26UL, 0x00000001UL, 0xd513ed24UL, 0x00000000UL, // x^157696 mod p(x)` << 1, x^157760 mod p(x)` << 1
0x170d56d6UL, 0x00000001UL, 0x141beadaUL, 0x00000000UL, // x^156672 mod p(x)` << 1, x^156736 mod p(x)` << 1
0xa5fb613cUL, 0x00000000UL, 0x1071aea0UL, 0x00000001UL, // x^155648 mod p(x)` << 1, x^155712 mod p(x)` << 1
0x40bbf7fcUL, 0x00000000UL, 0x2e19080aUL, 0x00000001UL, // x^154624 mod p(x)` << 1, x^154688 mod p(x)` << 1
0x6ac3a5b2UL, 0x00000001UL, 0x00ecf826UL, 0x00000001UL, // x^153600 mod p(x)` << 1, x^153664 mod p(x)` << 1
0xabf16230UL, 0x00000000UL, 0x69b09412UL, 0x00000000UL, // x^152576 mod p(x)` << 1, x^152640 mod p(x)` << 1
0xebe23facUL, 0x00000001UL, 0x22297bacUL, 0x00000001UL, // x^151552 mod p(x)` << 1, x^151616 mod p(x)` << 1
0x8b6a0894UL, 0x00000000UL, 0xe9e4b068UL, 0x00000000UL, // x^150528 mod p(x)` << 1, x^150592 mod p(x)` << 1
0x288ea478UL, 0x00000001UL, 0x4b38651aUL, 0x00000000UL, // x^149504 mod p(x)` << 1, x^149568 mod p(x)` << 1
0x6619c442UL, 0x00000001UL, 0x468360e2UL, 0x00000001UL, // x^148480 mod p(x)` << 1, x^148544 mod p(x)` << 1
0x86230038UL, 0x00000000UL, 0x121c2408UL, 0x00000000UL, // x^147456 mod p(x)` << 1, x^147520 mod p(x)` << 1
0x7746a756UL, 0x00000001UL, 0xda7e7d08UL, 0x00000000UL, // x^146432 mod p(x)` << 1, x^146496 mod p(x)` << 1
0x91b8f8f8UL, 0x00000001UL, 0x058d7652UL, 0x00000001UL, // x^145408 mod p(x)` << 1, x^145472 mod p(x)` << 1
0x8e167708UL, 0x00000000UL, 0x4a098a90UL, 0x00000001UL, // x^144384 mod p(x)` << 1, x^144448 mod p(x)` << 1
0x48b22d54UL, 0x00000001UL, 0x20dbe72eUL, 0x00000000UL, // x^143360 mod p(x)` << 1, x^143424 mod p(x)` << 1
0x44ba2c3cUL, 0x00000000UL, 0x1e7323e8UL, 0x00000001UL, // x^142336 mod p(x)` << 1, x^142400 mod p(x)` << 1
0xb54d2b52UL, 0x00000000UL, 0xd5d4bf94UL, 0x00000000UL, // x^141312 mod p(x)` << 1, x^141376 mod p(x)` << 1
0x05a4fd8aUL, 0x00000000UL, 0x99d8746cUL, 0x00000001UL, // x^140288 mod p(x)` << 1, x^140352 mod p(x)` << 1
0x39f9fc46UL, 0x00000001UL, 0xce9ca8a0UL, 0x00000000UL, // x^139264 mod p(x)` << 1, x^139328 mod p(x)` << 1
0x5a1fa824UL, 0x00000001UL, 0x136edeceUL, 0x00000000UL, // x^138240 mod p(x)` << 1, x^138304 mod p(x)` << 1
0x0a61ae4cUL, 0x00000000UL, 0x9b92a068UL, 0x00000001UL, // x^137216 mod p(x)` << 1, x^137280 mod p(x)` << 1
0x45e9113eUL, 0x00000001UL, 0x71d62206UL, 0x00000000UL, // x^136192 mod p(x)` << 1, x^136256 mod p(x)` << 1
0x6a348448UL, 0x00000000UL, 0xdfc50158UL, 0x00000000UL, // x^135168 mod p(x)` << 1, x^135232 mod p(x)` << 1
0x4d80a08cUL, 0x00000000UL, 0x517626bcUL, 0x00000001UL, // x^134144 mod p(x)` << 1, x^134208 mod p(x)` << 1
0x4b6837a0UL, 0x00000001UL, 0x48d1e4faUL, 0x00000001UL, // x^133120 mod p(x)` << 1, x^133184 mod p(x)` << 1
0x6896a7fcUL, 0x00000001UL, 0x94d8266eUL, 0x00000000UL, // x^132096 mod p(x)` << 1, x^132160 mod p(x)` << 1
0x4f187140UL, 0x00000001UL, 0x606c5e34UL, 0x00000000UL, // x^131072 mod p(x)` << 1, x^131136 mod p(x)` << 1
0x9581b9daUL, 0x00000001UL, 0x9766beaaUL, 0x00000001UL, // x^130048 mod p(x)` << 1, x^130112 mod p(x)` << 1
0x091bc984UL, 0x00000001UL, 0xd80c506cUL, 0x00000001UL, // x^129024 mod p(x)` << 1, x^129088 mod p(x)` << 1
0x1067223cUL, 0x00000000UL, 0x1e73837cUL, 0x00000000UL, // x^128000 mod p(x)` << 1, x^128064 mod p(x)` << 1
0xab16ea02UL, 0x00000001UL, 0x64d587deUL, 0x00000000UL, // x^126976 mod p(x)` << 1, x^127040 mod p(x)` << 1
0x3c4598a8UL, 0x00000001UL, 0xf4a507b0UL, 0x00000000UL, // x^125952 mod p(x)` << 1, x^126016 mod p(x)` << 1
0xb3735430UL, 0x00000000UL, 0x40e342fcUL, 0x00000000UL, // x^124928 mod p(x)` << 1, x^124992 mod p(x)` << 1
0xbb3fc0c0UL, 0x00000001UL, 0xd5ad9c3aUL, 0x00000001UL, // x^123904 mod p(x)` << 1, x^123968 mod p(x)` << 1
0x570ae19cUL, 0x00000001UL, 0x94a691a4UL, 0x00000000UL, // x^122880 mod p(x)` << 1, x^122944 mod p(x)` << 1
0xea910712UL, 0x00000001UL, 0x271ecdfaUL, 0x00000001UL, // x^121856 mod p(x)` << 1, x^121920 mod p(x)` << 1
0x67127128UL, 0x00000001UL, 0x9e54475aUL, 0x00000000UL, // x^120832 mod p(x)` << 1, x^120896 mod p(x)` << 1
0x19e790a2UL, 0x00000000UL, 0xc9c099eeUL, 0x00000000UL, // x^119808 mod p(x)` << 1, x^119872 mod p(x)` << 1
0x3788f710UL, 0x00000000UL, 0x9a2f736cUL, 0x00000000UL, // x^118784 mod p(x)` << 1, x^118848 mod p(x)` << 1
0x682a160eUL, 0x00000001UL, 0xbb9f4996UL, 0x00000000UL, // x^117760 mod p(x)` << 1, x^117824 mod p(x)` << 1
0x7f0ebd2eUL, 0x00000000UL, 0xdb688050UL, 0x00000001UL, // x^116736 mod p(x)` << 1, x^116800 mod p(x)` << 1
0x2b032080UL, 0x00000000UL, 0xe9b10af4UL, 0x00000000UL, // x^115712 mod p(x)` << 1, x^115776 mod p(x)` << 1
0xcfd1664aUL, 0x00000000UL, 0x2d4545e4UL, 0x00000001UL, // x^114688 mod p(x)` << 1, x^114752 mod p(x)` << 1
0xaa1181c2UL, 0x00000000UL, 0x0361139cUL, 0x00000000UL, // x^113664 mod p(x)` << 1, x^113728 mod p(x)` << 1
0xddd08002UL, 0x00000000UL, 0xa5a1a3a8UL, 0x00000001UL, // x^112640 mod p(x)` << 1, x^112704 mod p(x)` << 1
0xe8dd0446UL, 0x00000000UL, 0x6844e0b0UL, 0x00000000UL, // x^111616 mod p(x)` << 1, x^111680 mod p(x)` << 1
0xbbd94a00UL, 0x00000001UL, 0xc3762f28UL, 0x00000000UL, // x^110592 mod p(x)` << 1, x^110656 mod p(x)` << 1
0xab6cd180UL, 0x00000000UL, 0xd26287a2UL, 0x00000001UL, // x^109568 mod p(x)` << 1, x^109632 mod p(x)` << 1
0x31803ce2UL, 0x00000000UL, 0xf6f0bba8UL, 0x00000001UL, // x^108544 mod p(x)` << 1, x^108608 mod p(x)` << 1
0x24f40b0cUL, 0x00000000UL, 0x2ffabd62UL, 0x00000000UL, // x^107520 mod p(x)` << 1, x^107584 mod p(x)` << 1
0xba1d9834UL, 0x00000001UL, 0xfb4516b8UL, 0x00000000UL, // x^106496 mod p(x)` << 1, x^106560 mod p(x)` << 1
0x04de61aaUL, 0x00000001UL, 0x8cfa961cUL, 0x00000001UL, // x^105472 mod p(x)` << 1, x^105536 mod p(x)` << 1
0x13e40d46UL, 0x00000001UL, 0x9e588d52UL, 0x00000001UL, // x^104448 mod p(x)` << 1, x^104512 mod p(x)` << 1
0x415598a0UL, 0x00000001UL, 0x180f0bbcUL, 0x00000001UL, // x^103424 mod p(x)` << 1, x^103488 mod p(x)` << 1
0xbf6c8c90UL, 0x00000000UL, 0xe1d9177aUL, 0x00000000UL, // x^102400 mod p(x)` << 1, x^102464 mod p(x)` << 1
0x788b0504UL, 0x00000001UL, 0x05abc27cUL, 0x00000001UL, // x^101376 mod p(x)` << 1, x^101440 mod p(x)` << 1
0x38385d02UL, 0x00000000UL, 0x972e4a58UL, 0x00000000UL, // x^100352 mod p(x)` << 1, x^100416 mod p(x)` << 1
0xb6c83844UL, 0x00000001UL, 0x83499a5eUL, 0x00000001UL, // x^99328 mod p(x)` << 1, x^99392 mod p(x)` << 1
0x51061a8aUL, 0x00000000UL, 0xc96a8ccaUL, 0x00000001UL, // x^98304 mod p(x)` << 1, x^98368 mod p(x)` << 1
0x7351388aUL, 0x00000001UL, 0xa1a5b60cUL, 0x00000001UL, // x^97280 mod p(x)` << 1, x^97344 mod p(x)` << 1
0x32928f92UL, 0x00000001UL, 0xe4b6ac9cUL, 0x00000000UL, // x^96256 mod p(x)` << 1, x^96320 mod p(x)` << 1
0xe6b4f48aUL, 0x00000000UL, 0x807e7f5aUL, 0x00000001UL, // x^95232 mod p(x)` << 1, x^95296 mod p(x)` << 1
0x39d15e90UL, 0x00000000UL, 0x7a7e3bc8UL, 0x00000001UL, // x^94208 mod p(x)` << 1, x^94272 mod p(x)` << 1
0x312d6074UL, 0x00000000UL, 0xd73975daUL, 0x00000000UL, // x^93184 mod p(x)` << 1, x^93248 mod p(x)` << 1
0x7bbb2cc4UL, 0x00000001UL, 0x7375d038UL, 0x00000001UL, // x^92160 mod p(x)` << 1, x^92224 mod p(x)` << 1
0x6ded3e18UL, 0x00000001UL, 0x193680bcUL, 0x00000000UL, // x^91136 mod p(x)` << 1, x^91200 mod p(x)` << 1
0xf1638b16UL, 0x00000000UL, 0x999b06f6UL, 0x00000000UL, // x^90112 mod p(x)` << 1, x^90176 mod p(x)` << 1
0xd38b9eccUL, 0x00000001UL, 0xf685d2b8UL, 0x00000001UL, // x^89088 mod p(x)` << 1, x^89152 mod p(x)` << 1
0x8b8d09dcUL, 0x00000001UL, 0xf4ecbed2UL, 0x00000001UL, // x^88064 mod p(x)` << 1, x^88128 mod p(x)` << 1
0xe7bc27d2UL, 0x00000000UL, 0xba16f1a0UL, 0x00000000UL, // x^87040 mod p(x)` << 1, x^87104 mod p(x)` << 1
0x275e1e96UL, 0x00000000UL, 0x15aceac4UL, 0x00000001UL, // x^86016 mod p(x)` << 1, x^86080 mod p(x)` << 1
0xe2e3031eUL, 0x00000000UL, 0xaeff6292UL, 0x00000001UL, // x^84992 mod p(x)` << 1, x^85056 mod p(x)` << 1
0x041c84d8UL, 0x00000001UL, 0x9640124cUL, 0x00000000UL, // x^83968 mod p(x)` << 1, x^84032 mod p(x)` << 1
0x706ce672UL, 0x00000000UL, 0x14f41f02UL, 0x00000001UL, // x^82944 mod p(x)` << 1, x^83008 mod p(x)` << 1
0x5d5070daUL, 0x00000001UL, 0x9c5f3586UL, 0x00000000UL, // x^81920 mod p(x)` << 1, x^81984 mod p(x)` << 1
0x38f9493aUL, 0x00000000UL, 0x878275faUL, 0x00000001UL, // x^80896 mod p(x)` << 1, x^80960 mod p(x)` << 1
0xa3348a76UL, 0x00000000UL, 0xddc42ce8UL, 0x00000000UL, // x^79872 mod p(x)` << 1, x^79936 mod p(x)` << 1
0xad0aab92UL, 0x00000001UL, 0x81d2c73aUL, 0x00000001UL, // x^78848 mod p(x)` << 1, x^78912 mod p(x)` << 1
0x9e85f712UL, 0x00000001UL, 0x41c9320aUL, 0x00000001UL, // x^77824 mod p(x)` << 1, x^77888 mod p(x)` << 1
0x5a871e76UL, 0x00000000UL, 0x5235719aUL, 0x00000001UL, // x^76800 mod p(x)` << 1, x^76864 mod p(x)` << 1
0x7249c662UL, 0x00000001UL, 0xbe27d804UL, 0x00000000UL, // x^75776 mod p(x)` << 1, x^75840 mod p(x)` << 1
0x3a084712UL, 0x00000000UL, 0x6242d45aUL, 0x00000000UL, // x^74752 mod p(x)` << 1, x^74816 mod p(x)` << 1
0xed438478UL, 0x00000000UL, 0x9a53638eUL, 0x00000000UL, // x^73728 mod p(x)` << 1, x^73792 mod p(x)` << 1
0xabac34ccUL, 0x00000000UL, 0x001ecfb6UL, 0x00000001UL, // x^72704 mod p(x)` << 1, x^72768 mod p(x)` << 1
0x5f35ef3eUL, 0x00000000UL, 0x6d7c2d64UL, 0x00000001UL, // x^71680 mod p(x)` << 1, x^71744 mod p(x)` << 1
0x47d6608cUL, 0x00000000UL, 0xd0ce46c0UL, 0x00000001UL, // x^70656 mod p(x)` << 1, x^70720 mod p(x)` << 1
0x2d01470eUL, 0x00000000UL, 0x24c907b4UL, 0x00000001UL, // x^69632 mod p(x)` << 1, x^69696 mod p(x)` << 1
0x58bbc7b0UL, 0x00000001UL, 0x18a555caUL, 0x00000000UL, // x^68608 mod p(x)` << 1, x^68672 mod p(x)` << 1
0xc0a23e8eUL, 0x00000000UL, 0x6b0980bcUL, 0x00000000UL, // x^67584 mod p(x)` << 1, x^67648 mod p(x)` << 1
0xebd85c88UL, 0x00000001UL, 0x8bbba964UL, 0x00000000UL, // x^66560 mod p(x)` << 1, x^66624 mod p(x)` << 1
0x9ee20bb2UL, 0x00000001UL, 0x070a5a1eUL, 0x00000001UL, // x^65536 mod p(x)` << 1, x^65600 mod p(x)` << 1
0xacabf2d6UL, 0x00000001UL, 0x2204322aUL, 0x00000000UL, // x^64512 mod p(x)` << 1, x^64576 mod p(x)` << 1
0xb7963d56UL, 0x00000001UL, 0xa27524d0UL, 0x00000000UL, // x^63488 mod p(x)` << 1, x^63552 mod p(x)` << 1
0x7bffa1feUL, 0x00000001UL, 0x20b1e4baUL, 0x00000000UL, // x^62464 mod p(x)` << 1, x^62528 mod p(x)` << 1
0x1f15333eUL, 0x00000000UL, 0x32cc27fcUL, 0x00000000UL, // x^61440 mod p(x)` << 1, x^61504 mod p(x)` << 1
0x8593129eUL, 0x00000001UL, 0x44dd22b8UL, 0x00000000UL, // x^60416 mod p(x)` << 1, x^60480 mod p(x)` << 1
0x9cb32602UL, 0x00000001UL, 0xdffc9e0aUL, 0x00000000UL, // x^59392 mod p(x)` << 1, x^59456 mod p(x)` << 1
0x42b05cc8UL, 0x00000001UL, 0xb7a0ed14UL, 0x00000001UL, // x^58368 mod p(x)` << 1, x^58432 mod p(x)` << 1
0xbe49e7a4UL, 0x00000001UL, 0xc7842488UL, 0x00000000UL, // x^57344 mod p(x)` << 1, x^57408 mod p(x)` << 1
0x08f69d6cUL, 0x00000001UL, 0xc02a4feeUL, 0x00000001UL, // x^56320 mod p(x)` << 1, x^56384 mod p(x)` << 1
0x6c0971f0UL, 0x00000000UL, 0x3c273778UL, 0x00000000UL, // x^55296 mod p(x)` << 1, x^55360 mod p(x)` << 1
0x5b16467aUL, 0x00000000UL, 0xd63f8894UL, 0x00000001UL, // x^54272 mod p(x)` << 1, x^54336 mod p(x)` << 1
0x551a628eUL, 0x00000001UL, 0x6be557d6UL, 0x00000000UL, // x^53248 mod p(x)` << 1, x^53312 mod p(x)` << 1
0x9e42ea92UL, 0x00000001UL, 0x6a7806eaUL, 0x00000000UL, // x^52224 mod p(x)` << 1, x^52288 mod p(x)` << 1
0x2fa83ff2UL, 0x00000001UL, 0x6155aa0cUL, 0x00000001UL, // x^51200 mod p(x)` << 1, x^51264 mod p(x)` << 1
0x1ca9cde0UL, 0x00000001UL, 0x908650acUL, 0x00000000UL, // x^50176 mod p(x)` << 1, x^50240 mod p(x)` << 1
0xc8e5cd74UL, 0x00000000UL, 0xaa5a8084UL, 0x00000000UL, // x^49152 mod p(x)` << 1, x^49216 mod p(x)` << 1
0x96c27f0cUL, 0x00000000UL, 0x91bb500aUL, 0x00000001UL, // x^48128 mod p(x)` << 1, x^48192 mod p(x)` << 1
0x2baed926UL, 0x00000000UL, 0x64e9bed0UL, 0x00000000UL, // x^47104 mod p(x)` << 1, x^47168 mod p(x)` << 1
0x7c8de8d2UL, 0x00000001UL, 0x9444f302UL, 0x00000000UL, // x^46080 mod p(x)` << 1, x^46144 mod p(x)` << 1
0xd43d6068UL, 0x00000000UL, 0x9db07d3cUL, 0x00000001UL, // x^45056 mod p(x)` << 1, x^45120 mod p(x)` << 1
0xcb2c4b26UL, 0x00000000UL, 0x359e3e6eUL, 0x00000001UL, // x^44032 mod p(x)` << 1, x^44096 mod p(x)` << 1
0x45b8da26UL, 0x00000001UL, 0xe4f10dd2UL, 0x00000001UL, // x^43008 mod p(x)` << 1, x^43072 mod p(x)` << 1
0x8fff4b08UL, 0x00000001UL, 0x24f5735eUL, 0x00000001UL, // x^41984 mod p(x)` << 1, x^42048 mod p(x)` << 1
0x50b58ed0UL, 0x00000001UL, 0x24760a4cUL, 0x00000001UL, // x^40960 mod p(x)` << 1, x^41024 mod p(x)` << 1
0x549f39bcUL, 0x00000001UL, 0x0f1fc186UL, 0x00000000UL, // x^39936 mod p(x)` << 1, x^40000 mod p(x)` << 1
0xef4d2f42UL, 0x00000000UL, 0x150e4cc4UL, 0x00000000UL, // x^38912 mod p(x)` << 1, x^38976 mod p(x)` << 1
0xb1468572UL, 0x00000001UL, 0x2a6204e8UL, 0x00000000UL, // x^37888 mod p(x)` << 1, x^37952 mod p(x)` << 1
0x3d7403b2UL, 0x00000001UL, 0xbeb1d432UL, 0x00000000UL, // x^36864 mod p(x)` << 1, x^36928 mod p(x)` << 1
0xa4681842UL, 0x00000001UL, 0x35f3f1f0UL, 0x00000001UL, // x^35840 mod p(x)` << 1, x^35904 mod p(x)` << 1
0x67714492UL, 0x00000001UL, 0x74fe2232UL, 0x00000000UL, // x^34816 mod p(x)` << 1, x^34880 mod p(x)` << 1
0xe599099aUL, 0x00000001UL, 0x1ac6e2baUL, 0x00000000UL, // x^33792 mod p(x)` << 1, x^33856 mod p(x)` << 1
0xfe128194UL, 0x00000000UL, 0x13fca91eUL, 0x00000000UL, // x^32768 mod p(x)` << 1, x^32832 mod p(x)` << 1
0x77e8b990UL, 0x00000000UL, 0x83f4931eUL, 0x00000001UL, // x^31744 mod p(x)` << 1, x^31808 mod p(x)` << 1
0xa267f63aUL, 0x00000001UL, 0xb6d9b4e4UL, 0x00000000UL, // x^30720 mod p(x)` << 1, x^30784 mod p(x)` << 1
0x945c245aUL, 0x00000001UL, 0xb5188656UL, 0x00000000UL, // x^29696 mod p(x)` << 1, x^29760 mod p(x)` << 1
0x49002e76UL, 0x00000001UL, 0x27a81a84UL, 0x00000000UL, // x^28672 mod p(x)` << 1, x^28736 mod p(x)` << 1
0xbb8310a4UL, 0x00000001UL, 0x25699258UL, 0x00000001UL, // x^27648 mod p(x)` << 1, x^27712 mod p(x)` << 1
0x9ec60bccUL, 0x00000001UL, 0xb23de796UL, 0x00000001UL, // x^26624 mod p(x)` << 1, x^26688 mod p(x)` << 1
0x2d8590aeUL, 0x00000001UL, 0xfe4365dcUL, 0x00000000UL, // x^25600 mod p(x)` << 1, x^25664 mod p(x)` << 1
0x65b00684UL, 0x00000000UL, 0xc68f497aUL, 0x00000000UL, // x^24576 mod p(x)` << 1, x^24640 mod p(x)` << 1
0x5e5aeadcUL, 0x00000001UL, 0xfbf521eeUL, 0x00000000UL, // x^23552 mod p(x)` << 1, x^23616 mod p(x)` << 1
0xb77ff2b0UL, 0x00000000UL, 0x5eac3378UL, 0x00000001UL, // x^22528 mod p(x)` << 1, x^22592 mod p(x)` << 1
0x88da2ff6UL, 0x00000001UL, 0x34914b90UL, 0x00000001UL, // x^21504 mod p(x)` << 1, x^21568 mod p(x)` << 1
0x63da929aUL, 0x00000000UL, 0x16335cfeUL, 0x00000000UL, // x^20480 mod p(x)` << 1, x^20544 mod p(x)` << 1
0x389caa80UL, 0x00000001UL, 0x0372d10cUL, 0x00000001UL, // x^19456 mod p(x)` << 1, x^19520 mod p(x)` << 1
0x3db599d2UL, 0x00000001UL, 0x5097b908UL, 0x00000001UL, // x^18432 mod p(x)` << 1, x^18496 mod p(x)` << 1
0x22505a86UL, 0x00000001UL, 0x227a7572UL, 0x00000001UL, // x^17408 mod p(x)` << 1, x^17472 mod p(x)` << 1
0x6bd72746UL, 0x00000001UL, 0x9a8f75c0UL, 0x00000000UL, // x^16384 mod p(x)` << 1, x^16448 mod p(x)` << 1
0xc3faf1d4UL, 0x00000001UL, 0x682c77a2UL, 0x00000000UL, // x^15360 mod p(x)` << 1, x^15424 mod p(x)` << 1
0x111c826cUL, 0x00000001UL, 0x231f091cUL, 0x00000000UL, // x^14336 mod p(x)` << 1, x^14400 mod p(x)` << 1
0x153e9fb2UL, 0x00000000UL, 0x7d4439f2UL, 0x00000000UL, // x^13312 mod p(x)` << 1, x^13376 mod p(x)` << 1
0x2b1f7b60UL, 0x00000000UL, 0x7e221efcUL, 0x00000001UL, // x^12288 mod p(x)` << 1, x^12352 mod p(x)` << 1
0xb1dba570UL, 0x00000000UL, 0x67457c38UL, 0x00000001UL, // x^11264 mod p(x)` << 1, x^11328 mod p(x)` << 1
0xf6397b76UL, 0x00000001UL, 0xbdf081c4UL, 0x00000000UL, // x^10240 mod p(x)` << 1, x^10304 mod p(x)` << 1
0x56335214UL, 0x00000001UL, 0x6286d6b0UL, 0x00000001UL, // x^9216 mod p(x)` << 1, x^9280 mod p(x)` << 1
0xd70e3986UL, 0x00000001UL, 0xc84f001cUL, 0x00000000UL, // x^8192 mod p(x)` << 1, x^8256 mod p(x)` << 1
0x3701a774UL, 0x00000000UL, 0x64efe7c0UL, 0x00000000UL, // x^7168 mod p(x)` << 1, x^7232 mod p(x)` << 1
0xac81ef72UL, 0x00000000UL, 0x0ac2d904UL, 0x00000000UL, // x^6144 mod p(x)` << 1, x^6208 mod p(x)` << 1
0x33212464UL, 0x00000001UL, 0xfd226d14UL, 0x00000000UL, // x^5120 mod p(x)` << 1, x^5184 mod p(x)` << 1
0xe4e45610UL, 0x00000000UL, 0x1cfd42e0UL, 0x00000001UL, // x^4096 mod p(x)` << 1, x^4160 mod p(x)` << 1
0x0c1bd370UL, 0x00000000UL, 0x6e5a5678UL, 0x00000001UL, // x^3072 mod p(x)` << 1, x^3136 mod p(x)` << 1
0xa7b9e7a6UL, 0x00000001UL, 0xd888fe22UL, 0x00000001UL, // x^2048 mod p(x)` << 1, x^2112 mod p(x)` << 1
0x7d657a10UL, 0x00000000UL, 0xaf77fcd4UL, 0x00000001UL, // x^1024 mod p(x)` << 1, x^1088 mod p(x)` << 1
// Reduce final 1024-2048 bits to 64 bits, shifting 32 bits to include the trailing 32 bits of zeros
0xec447f11UL, 0x99168a18UL, 0x13e8221eUL, 0xed837b26UL, // x^2048 mod p(x)`, x^2016 mod p(x)`, x^1984 mod p(x)`, x^1952 mod p(x)`
0x8fd2cd3cUL, 0xe23e954eUL, 0x47b9ce5aUL, 0xc8acdd81UL, // x^1920 mod p(x)`, x^1888 mod p(x)`, x^1856 mod p(x)`, x^1824 mod p(x)`
0x6b1d2b53UL, 0x92f8befeUL, 0xd4277e25UL, 0xd9ad6d87UL, // x^1792 mod p(x)`, x^1760 mod p(x)`, x^1728 mod p(x)`, x^1696 mod p(x)`
0x291ea462UL, 0xf38a3556UL, 0x33fbca3bUL, 0xc10ec5e0UL, // x^1664 mod p(x)`, x^1632 mod p(x)`, x^1600 mod p(x)`, x^1568 mod p(x)`
0x62b6ca4bUL, 0x974ac562UL, 0x82e02e2fUL, 0xc0b55b0eUL, // x^1536 mod p(x)`, x^1504 mod p(x)`, x^1472 mod p(x)`, x^1440 mod p(x)`
0x784d2a56UL, 0x855712b3UL, 0xe172334dUL, 0x71aa1df0UL, // x^1408 mod p(x)`, x^1376 mod p(x)`, x^1344 mod p(x)`, x^1312 mod p(x)`
0x0eaee722UL, 0xa5abe9f8UL, 0x3969324dUL, 0xfee3053eUL, // x^1280 mod p(x)`, x^1248 mod p(x)`, x^1216 mod p(x)`, x^1184 mod p(x)`
0xdb54814cUL, 0x1fa0943dUL, 0x3eb2bd08UL, 0xf44779b9UL, // x^1152 mod p(x)`, x^1120 mod p(x)`, x^1088 mod p(x)`, x^1056 mod p(x)`
0xd7bbfe6aUL, 0xa53ff440UL, 0x00cc3374UL, 0xf5449b3fUL, // x^1024 mod p(x)`, x^992 mod p(x)`, x^960 mod p(x)`, x^928 mod p(x)`
0x6325605cUL, 0xebe7e356UL, 0xd777606eUL, 0x6f8346e1UL, // x^896 mod p(x)`, x^864 mod p(x)`, x^832 mod p(x)`, x^800 mod p(x)`
0xe5b592b8UL, 0xc65a272cUL, 0xc0b95347UL, 0xe3ab4f2aUL, // x^768 mod p(x)`, x^736 mod p(x)`, x^704 mod p(x)`, x^672 mod p(x)`
0x4721589fUL, 0x5705a9caUL, 0x329ecc11UL, 0xaa2215eaUL, // x^640 mod p(x)`, x^608 mod p(x)`, x^576 mod p(x)`, x^544 mod p(x)`
0x88d14467UL, 0xe3720acbUL, 0xd95efd26UL, 0x1ed8f66eUL, // x^512 mod p(x)`, x^480 mod p(x)`, x^448 mod p(x)`, x^416 mod p(x)`
0x15141c31UL, 0xba1aca03UL, 0xa700e96aUL, 0x78ed02d5UL, // x^384 mod p(x)`, x^352 mod p(x)`, x^320 mod p(x)`, x^288 mod p(x)`
0xed627daeUL, 0xad2a31b3UL, 0x32b39da3UL, 0xba8ccbe8UL, // x^256 mod p(x)`, x^224 mod p(x)`, x^192 mod p(x)`, x^160 mod p(x)`
0xa06a2517UL, 0x6655004fUL, 0xb1e6b092UL, 0xedb88320UL // x^128 mod p(x)`, x^96 mod p(x)`, x^64 mod p(x)`, x^32 mod p(x)`
};
juint* ptr = (juint*) malloc(sizeof(juint) * CRC32_CONSTANTS_SIZE);
guarantee(((intptr_t)ptr & 0xF) == 0, "16-byte alignment needed");
guarantee(ptr != NULL, "allocation error of a crc table");
memcpy((void*)ptr, constants, sizeof(juint) * CRC32_CONSTANTS_SIZE);
return ptr;
}
juint* StubRoutines::ppc64::generate_crc_barret_constants() {
juint barret_constants[CRC32_BARRET_CONSTANTS] = {
0xf7011641UL, 0x00000001UL, 0x00000000UL, 0x00000000UL,
0xdb710641UL, 0x00000001UL, 0x00000000UL, 0x00000000UL
};
juint* ptr = (juint*) malloc(sizeof(juint) * CRC32_CONSTANTS_SIZE);
guarantee(((intptr_t)ptr & 0xF) == 0, "16-byte alignment needed");
guarantee(ptr != NULL, "allocation error of a crc table");
memcpy((void*) ptr, barret_constants, sizeof(juint) * CRC32_BARRET_CONSTANTS);
return ptr;
}
// CRC32 Intrinsics. // CRC32 Intrinsics.
/** /**
* crc_table[] from jdk/src/share/native/java/util/zip/zlib-1.2.8/crc32.h * crc_table[] from jdk/src/share/native/java/util/zip/zlib-1.2.8/crc32.h
@ -477,3 +782,7 @@ juint StubRoutines::ppc64::_crc_table[CRC32_TABLES][CRC32_COLUMN_SIZE] = {
#endif #endif
} }
}; };
juint* StubRoutines::ppc64::_constants = StubRoutines::ppc64::generate_crc_constants();
juint* StubRoutines::ppc64::_barret_constants = StubRoutines::ppc64::generate_crc_barret_constants();

View file

@ -230,6 +230,11 @@ void VM_Version::initialize() {
FLAG_SET_DEFAULT(UseGHASHIntrinsics, false); FLAG_SET_DEFAULT(UseGHASHIntrinsics, false);
} }
if (UseFMA) {
warning("FMA instructions are not available on this CPU");
FLAG_SET_DEFAULT(UseFMA, false);
}
if (UseSHA) { if (UseSHA) {
warning("SHA instructions are not available on this CPU"); warning("SHA instructions are not available on this CPU");
FLAG_SET_DEFAULT(UseSHA, false); FLAG_SET_DEFAULT(UseSHA, false);
@ -274,7 +279,14 @@ void VM_Version::initialize() {
} }
bool os_too_old = true; bool os_too_old = true;
#ifdef AIX #ifdef AIX
if (os::Aix::os_version() >= 0x0701031e) { // at least AIX 7.1.3.30 // Actually, this is supported since AIX 7.1.. Unfortunately, this first
// contained bugs, so that it can only be enabled after AIX 7.1.3.30.
// The Java property os.version, which is used in RTM tests to decide
// whether the feature is available, only knows major and minor versions.
// We don't want to change this property, as user code might depend on it.
// So the tests can not check on subversion 3.30, and we only enable RTM
// with AIX 7.2.
if (os::Aix::os_version() >= 0x07020000) { // At least AIX 7.2.
os_too_old = false; os_too_old = false;
} }
#endif #endif

View file

@ -147,10 +147,11 @@ LIR_Opr LIRGenerator::safepoint_poll_register() {
LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index, LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index,
int shift, int disp, BasicType type) { int shift, int disp, BasicType type) {
assert(base->is_register(), "must be"); assert(base->is_register(), "must be");
intx large_disp = disp;
// accumulate fixed displacements // accumulate fixed displacements
if (index->is_constant()) { if (index->is_constant()) {
disp += index->as_constant_ptr()->as_jint() << shift; large_disp += (intx)(index->as_constant_ptr()->as_jint()) << shift;
index = LIR_OprFact::illegalOpr; index = LIR_OprFact::illegalOpr;
} }
@ -161,31 +162,31 @@ LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index,
__ shift_left(index, shift, tmp); __ shift_left(index, shift, tmp);
index = tmp; index = tmp;
} }
if (disp != 0) { if (large_disp != 0) {
LIR_Opr tmp = new_pointer_register(); LIR_Opr tmp = new_pointer_register();
if (Assembler::is_simm13(disp)) { if (Assembler::is_simm13(large_disp)) {
__ add(tmp, LIR_OprFact::intptrConst(disp), tmp); __ add(tmp, LIR_OprFact::intptrConst(large_disp), tmp);
index = tmp; index = tmp;
} else { } else {
__ move(LIR_OprFact::intptrConst(disp), tmp); __ move(LIR_OprFact::intptrConst(large_disp), tmp);
__ add(tmp, index, tmp); __ add(tmp, index, tmp);
index = tmp; index = tmp;
} }
disp = 0; large_disp = 0;
} }
} else if (disp != 0 && !Assembler::is_simm13(disp)) { } else if (large_disp != 0 && !Assembler::is_simm13(large_disp)) {
// index is illegal so replace it with the displacement loaded into a register // index is illegal so replace it with the displacement loaded into a register
index = new_pointer_register(); index = new_pointer_register();
__ move(LIR_OprFact::intptrConst(disp), index); __ move(LIR_OprFact::intptrConst(large_disp), index);
disp = 0; large_disp = 0;
} }
// at this point we either have base + index or base + displacement // at this point we either have base + index or base + displacement
if (disp == 0) { if (large_disp == 0) {
return new LIR_Address(base, index, type); return new LIR_Address(base, index, type);
} else { } else {
assert(Assembler::is_simm13(disp), "must be"); assert(Assembler::is_simm13(large_disp), "must be");
return new LIR_Address(base, disp, type); return new LIR_Address(base, large_disp, type);
} }
} }
@ -196,11 +197,11 @@ LIR_Address* LIRGenerator::emit_array_address(LIR_Opr array_opr, LIR_Opr index_o
int shift = exact_log2(elem_size); int shift = exact_log2(elem_size);
LIR_Opr base_opr; LIR_Opr base_opr;
int offset = arrayOopDesc::base_offset_in_bytes(type); intx offset = arrayOopDesc::base_offset_in_bytes(type);
if (index_opr->is_constant()) { if (index_opr->is_constant()) {
int i = index_opr->as_constant_ptr()->as_jint(); intx i = index_opr->as_constant_ptr()->as_jint();
int array_offset = i * elem_size; intx array_offset = i * elem_size;
if (Assembler::is_simm13(array_offset + offset)) { if (Assembler::is_simm13(array_offset + offset)) {
base_opr = array_opr; base_opr = array_opr;
offset = array_offset + offset; offset = array_offset + offset;
@ -953,6 +954,10 @@ void LIRGenerator::do_update_CRC32C(Intrinsic* x) {
} }
} }
void LIRGenerator::do_FmaIntrinsic(Intrinsic* x) {
fatal("FMA intrinsic is not implemented on this platform");
}
void LIRGenerator::do_vectorizedMismatch(Intrinsic* x) { void LIRGenerator::do_vectorizedMismatch(Intrinsic* x) {
fatal("vectorizedMismatch intrinsic is not implemented on this platform"); fatal("vectorizedMismatch intrinsic is not implemented on this platform");
} }

View file

@ -881,20 +881,15 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
__ delayed()->st_ptr(tmp, G2_thread, satb_q_index_byte_offset); __ delayed()->st_ptr(tmp, G2_thread, satb_q_index_byte_offset);
__ bind(refill); __ bind(refill);
__ save_frame(0);
__ mov(pre_val, L0); save_live_registers(sasm);
__ mov(tmp, L1);
__ mov(tmp2, L2);
__ call_VM_leaf(L7_thread_cache, __ call_VM_leaf(L7_thread_cache,
CAST_FROM_FN_PTR(address, CAST_FROM_FN_PTR(address,
SATBMarkQueueSet::handle_zero_index_for_thread), SATBMarkQueueSet::handle_zero_index_for_thread),
G2_thread); G2_thread);
__ mov(L0, pre_val); restore_live_registers(sasm);
__ mov(L1, tmp);
__ mov(L2, tmp2);
__ br(Assembler::always, /*annul*/false, Assembler::pt, restart); __ br(Assembler::always, /*annul*/false, Assembler::pt, restart);
__ delayed()->restore(); __ delayed()->restore();
@ -986,20 +981,15 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
__ delayed()->st_ptr(tmp3, G2_thread, dirty_card_q_index_byte_offset); __ delayed()->st_ptr(tmp3, G2_thread, dirty_card_q_index_byte_offset);
__ bind(refill); __ bind(refill);
__ save_frame(0);
__ mov(tmp2, L0); save_live_registers(sasm);
__ mov(tmp3, L1);
__ mov(tmp4, L2);
__ call_VM_leaf(L7_thread_cache, __ call_VM_leaf(L7_thread_cache,
CAST_FROM_FN_PTR(address, CAST_FROM_FN_PTR(address,
DirtyCardQueueSet::handle_zero_index_for_thread), DirtyCardQueueSet::handle_zero_index_for_thread),
G2_thread); G2_thread);
__ mov(L0, tmp2); restore_live_registers(sasm);
__ mov(L1, tmp3);
__ mov(L2, tmp4);
__ br(Assembler::always, /*annul*/false, Assembler::pt, restart); __ br(Assembler::always, /*annul*/false, Assembler::pt, restart);
__ delayed()->restore(); __ delayed()->restore();

View file

@ -266,6 +266,11 @@ void VM_Version::initialize() {
FLAG_SET_DEFAULT(UseGHASHIntrinsics, false); FLAG_SET_DEFAULT(UseGHASHIntrinsics, false);
} }
if (UseFMA) {
warning("FMA instructions are not available on this CPU");
FLAG_SET_DEFAULT(UseFMA, false);
}
// SHA1, SHA256, and SHA512 instructions were added to SPARC T-series at different times // SHA1, SHA256, and SHA512 instructions were added to SPARC T-series at different times
if (has_sha1() || has_sha256() || has_sha512()) { if (has_sha1() || has_sha256() || has_sha512()) {
if (UseVIS > 0) { // SHA intrinsics use VIS1 instructions if (UseVIS > 0) { // SHA intrinsics use VIS1 instructions

View file

@ -172,7 +172,9 @@ bool AbstractInterpreter::can_be_compiled(methodHandle m) {
case Interpreter::java_lang_math_log10 : // fall thru case Interpreter::java_lang_math_log10 : // fall thru
case Interpreter::java_lang_math_sqrt : // fall thru case Interpreter::java_lang_math_sqrt : // fall thru
case Interpreter::java_lang_math_pow : // fall thru case Interpreter::java_lang_math_pow : // fall thru
case Interpreter::java_lang_math_exp : case Interpreter::java_lang_math_exp : // fall thru
case Interpreter::java_lang_math_fmaD : // fall thru
case Interpreter::java_lang_math_fmaF :
return false; return false;
default: default:
return true; return true;

View file

@ -4769,6 +4769,22 @@ void Assembler::vdivss(XMMRegister dst, XMMRegister nds, XMMRegister src) {
emit_int8((unsigned char)(0xC0 | encode)); emit_int8((unsigned char)(0xC0 | encode));
} }
void Assembler::vfmadd231sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
assert(VM_Version::supports_fma(), "");
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false);
int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
emit_int8((unsigned char)0xB9);
emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::vfmadd231ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) {
assert(VM_Version::supports_fma(), "");
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false);
int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes);
emit_int8((unsigned char)0xB9);
emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::vmulsd(XMMRegister dst, XMMRegister nds, Address src) { void Assembler::vmulsd(XMMRegister dst, XMMRegister nds, Address src) {
assert(VM_Version::supports_avx(), ""); assert(VM_Version::supports_avx(), "");
InstructionMark im(this); InstructionMark im(this);

View file

@ -1860,6 +1860,8 @@ private:
void vdivsd(XMMRegister dst, XMMRegister nds, XMMRegister src); void vdivsd(XMMRegister dst, XMMRegister nds, XMMRegister src);
void vdivss(XMMRegister dst, XMMRegister nds, Address src); void vdivss(XMMRegister dst, XMMRegister nds, Address src);
void vdivss(XMMRegister dst, XMMRegister nds, XMMRegister src); void vdivss(XMMRegister dst, XMMRegister nds, XMMRegister src);
void vfmadd231sd(XMMRegister dst, XMMRegister nds, XMMRegister src);
void vfmadd231ss(XMMRegister dst, XMMRegister nds, XMMRegister src);
void vmulsd(XMMRegister dst, XMMRegister nds, Address src); void vmulsd(XMMRegister dst, XMMRegister nds, Address src);
void vmulsd(XMMRegister dst, XMMRegister nds, XMMRegister src); void vmulsd(XMMRegister dst, XMMRegister nds, XMMRegister src);
void vmulss(XMMRegister dst, XMMRegister nds, Address src); void vmulss(XMMRegister dst, XMMRegister nds, Address src);

View file

@ -1345,6 +1345,18 @@ void LIR_Assembler::emit_op3(LIR_Op3* op) {
op->result_opr(), op->result_opr(),
op->info()); op->info());
break; break;
case lir_fmad:
__ fmad(op->result_opr()->as_xmm_double_reg(),
op->in_opr1()->as_xmm_double_reg(),
op->in_opr2()->as_xmm_double_reg(),
op->in_opr3()->as_xmm_double_reg());
break;
case lir_fmaf:
__ fmaf(op->result_opr()->as_xmm_float_reg(),
op->in_opr1()->as_xmm_float_reg(),
op->in_opr2()->as_xmm_float_reg(),
op->in_opr3()->as_xmm_float_reg());
break;
default: ShouldNotReachHere(); break; default: ShouldNotReachHere(); break;
} }
} }

View file

@ -152,7 +152,7 @@ LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index,
assert(base->is_register(), "must be"); assert(base->is_register(), "must be");
if (index->is_constant()) { if (index->is_constant()) {
return new LIR_Address(base, return new LIR_Address(base,
(index->as_constant_ptr()->as_jint() << shift) + disp, ((intx)(index->as_constant_ptr()->as_jint()) << shift) + disp,
type); type);
} else { } else {
return new LIR_Address(base, index, (LIR_Address::Scale)shift, disp, type); return new LIR_Address(base, index, (LIR_Address::Scale)shift, disp, type);
@ -168,7 +168,7 @@ LIR_Address* LIRGenerator::emit_array_address(LIR_Opr array_opr, LIR_Opr index_o
if (index_opr->is_constant()) { if (index_opr->is_constant()) {
int elem_size = type2aelembytes(type); int elem_size = type2aelembytes(type);
addr = new LIR_Address(array_opr, addr = new LIR_Address(array_opr,
offset_in_bytes + index_opr->as_jint() * elem_size, type); offset_in_bytes + (intx)(index_opr->as_jint()) * elem_size, type);
} else { } else {
#ifdef _LP64 #ifdef _LP64
if (index_opr->type() == T_INT) { if (index_opr->type() == T_INT) {
@ -806,6 +806,32 @@ void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) {
} }
} }
void LIRGenerator::do_FmaIntrinsic(Intrinsic* x) {
assert(x->number_of_arguments() == 3, "wrong type");
assert(UseFMA, "Needs FMA instructions support.");
LIRItem value(x->argument_at(0), this);
LIRItem value1(x->argument_at(1), this);
LIRItem value2(x->argument_at(2), this);
value2.set_destroys_register();
value.load_item();
value1.load_item();
value2.load_item();
LIR_Opr calc_input = value.result();
LIR_Opr calc_input1 = value1.result();
LIR_Opr calc_input2 = value2.result();
LIR_Opr calc_result = rlock_result(x);
switch (x->id()) {
case vmIntrinsics::_fmaD: __ fmad(calc_input, calc_input1, calc_input2, calc_result); break;
case vmIntrinsics::_fmaF: __ fmaf(calc_input, calc_input1, calc_input2, calc_result); break;
default: ShouldNotReachHere();
}
}
void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { void LIRGenerator::do_MathIntrinsic(Intrinsic* x) {
assert(x->number_of_arguments() == 1 || (x->number_of_arguments() == 2 && x->id() == vmIntrinsics::_dpow), "wrong type"); assert(x->number_of_arguments() == 1 || (x->number_of_arguments() == 2 && x->id() == vmIntrinsics::_dpow), "wrong type");

View file

@ -100,9 +100,11 @@ inline void LinearScan::pd_add_temps(LIR_Op* op) {
inline bool LinearScanWalker::pd_init_regs_for_alloc(Interval* cur) { inline bool LinearScanWalker::pd_init_regs_for_alloc(Interval* cur) {
int last_xmm_reg = pd_last_xmm_reg; int last_xmm_reg = pd_last_xmm_reg;
#ifdef _LP64
if (UseAVX < 3) { if (UseAVX < 3) {
last_xmm_reg = pd_first_xmm_reg + (pd_nof_xmm_regs_frame_map / 2) - 1; last_xmm_reg = pd_first_xmm_reg + (pd_nof_xmm_regs_frame_map / 2) - 1;
} }
#endif
if (allocator()->gen()->is_vreg_flag_set(cur->reg_num(), LIRGenerator::byte_reg)) { if (allocator()->gen()->is_vreg_flag_set(cur->reg_num(), LIRGenerator::byte_reg)) {
assert(cur->type() != T_FLOAT && cur->type() != T_DOUBLE, "cpu regs only"); assert(cur->type() != T_FLOAT && cur->type() != T_DOUBLE, "cpu regs only");
_first_reg = pd_first_byte_reg; _first_reg = pd_first_byte_reg;

View file

@ -3147,6 +3147,24 @@ void MacroAssembler::fremr(Register tmp) {
fpop(); fpop();
} }
// dst = c = a * b + c
void MacroAssembler::fmad(XMMRegister dst, XMMRegister a, XMMRegister b, XMMRegister c) {
Assembler::vfmadd231sd(c, a, b);
if (dst != c) {
movdbl(dst, c);
}
}
// dst = c = a * b + c
void MacroAssembler::fmaf(XMMRegister dst, XMMRegister a, XMMRegister b, XMMRegister c) {
Assembler::vfmadd231ss(c, a, b);
if (dst != c) {
movflt(dst, c);
}
}
void MacroAssembler::incrementl(AddressLiteral dst) { void MacroAssembler::incrementl(AddressLiteral dst) {
if (reachable(dst)) { if (reachable(dst)) {

View file

@ -449,6 +449,10 @@ class MacroAssembler: public Assembler {
// tmp is a temporary register, if none is available use noreg // tmp is a temporary register, if none is available use noreg
void fremr(Register tmp); void fremr(Register tmp);
// dst = c = a * b + c
void fmad(XMMRegister dst, XMMRegister a, XMMRegister b, XMMRegister c);
void fmaf(XMMRegister dst, XMMRegister a, XMMRegister b, XMMRegister c);
// same as fcmp2int, but using SSE2 // same as fcmp2int, but using SSE2
void cmpss2int(XMMRegister opr1, XMMRegister opr2, Register dst, bool unordered_is_less); void cmpss2int(XMMRegister opr1, XMMRegister opr2, Register dst, bool unordered_is_less);

View file

@ -720,19 +720,13 @@ const Register& y2 = r15;
enum { enum {
_XFER_SIZE = 2*64*4, // 2 blocks, 64 rounds, 4 bytes/round _XFER_SIZE = 2*64*4, // 2 blocks, 64 rounds, 4 bytes/round
#ifndef _WIN64
_XMM_SAVE_SIZE = 0,
#else
_XMM_SAVE_SIZE = 8*16,
#endif
_INP_END_SIZE = 8, _INP_END_SIZE = 8,
_INP_SIZE = 8, _INP_SIZE = 8,
_CTX_SIZE = 8, _CTX_SIZE = 8,
_RSP_SIZE = 8, _RSP_SIZE = 8,
_XFER = 0, _XFER = 0,
_XMM_SAVE = _XFER + _XFER_SIZE, _INP_END = _XFER + _XFER_SIZE,
_INP_END = _XMM_SAVE + _XMM_SAVE_SIZE,
_INP = _INP_END + _INP_END_SIZE, _INP = _INP_END + _INP_END_SIZE,
_CTX = _INP + _INP_SIZE, _CTX = _INP + _INP_SIZE,
_RSP = _CTX + _CTX_SIZE, _RSP = _CTX + _CTX_SIZE,

View file

@ -3236,11 +3236,6 @@ class StubGenerator: public StubCodeGenerator {
#ifdef _WIN64 #ifdef _WIN64
// on win64, fill len_reg from stack position // on win64, fill len_reg from stack position
__ movl(len_reg, len_mem); __ movl(len_reg, len_mem);
// save the xmm registers which must be preserved 6-15
__ subptr(rsp, -rsp_after_call_off * wordSize);
for (int i = 6; i <= XMM_REG_NUM_KEY_LAST; i++) {
__ movdqu(xmm_save(i), as_XMMRegister(i));
}
#else #else
__ push(len_reg); // Save __ push(len_reg); // Save
#endif #endif
@ -3281,10 +3276,6 @@ class StubGenerator: public StubCodeGenerator {
__ movdqu(Address(rvec, 0), xmm_result); // final value of r stored in rvec of CipherBlockChaining object __ movdqu(Address(rvec, 0), xmm_result); // final value of r stored in rvec of CipherBlockChaining object
#ifdef _WIN64 #ifdef _WIN64
// restore xmm regs belonging to calling function
for (int i = 6; i <= XMM_REG_NUM_KEY_LAST; i++) {
__ movdqu(as_XMMRegister(i), xmm_save(i));
}
__ movl(rax, len_mem); __ movl(rax, len_mem);
#else #else
__ pop(rax); // return length __ pop(rax); // return length
@ -3446,11 +3437,6 @@ class StubGenerator: public StubCodeGenerator {
#ifdef _WIN64 #ifdef _WIN64
// on win64, fill len_reg from stack position // on win64, fill len_reg from stack position
__ movl(len_reg, len_mem); __ movl(len_reg, len_mem);
// save the xmm registers which must be preserved 6-15
__ subptr(rsp, -rsp_after_call_off * wordSize);
for (int i = 6; i <= XMM_REG_NUM_KEY_LAST; i++) {
__ movdqu(xmm_save(i), as_XMMRegister(i));
}
#else #else
__ push(len_reg); // Save __ push(len_reg); // Save
#endif #endif
@ -3644,10 +3630,6 @@ class StubGenerator: public StubCodeGenerator {
__ movdqu(Address(rvec, 0), xmm_prev_block_cipher); // final value of r stored in rvec of CipherBlockChaining object __ movdqu(Address(rvec, 0), xmm_prev_block_cipher); // final value of r stored in rvec of CipherBlockChaining object
__ pop(rbx); __ pop(rbx);
#ifdef _WIN64 #ifdef _WIN64
// restore regs belonging to calling function
for (int i = 6; i <= XMM_REG_NUM_KEY_LAST; i++) {
__ movdqu(as_XMMRegister(i), xmm_save(i));
}
__ movl(rax, len_mem); __ movl(rax, len_mem);
#else #else
__ pop(rax); // return length __ pop(rax); // return length
@ -3699,25 +3681,12 @@ class StubGenerator: public StubCodeGenerator {
__ enter(); __ enter();
#ifdef _WIN64
// save the xmm registers which must be preserved 6-7
__ subptr(rsp, 4 * wordSize);
__ movdqu(Address(rsp, 0), xmm6);
__ movdqu(Address(rsp, 2 * wordSize), xmm7);
#endif
__ subptr(rsp, 4 * wordSize); __ subptr(rsp, 4 * wordSize);
__ fast_sha1(abcd, e0, e1, msg0, msg1, msg2, msg3, shuf_mask, __ fast_sha1(abcd, e0, e1, msg0, msg1, msg2, msg3, shuf_mask,
buf, state, ofs, limit, rsp, multi_block); buf, state, ofs, limit, rsp, multi_block);
__ addptr(rsp, 4 * wordSize); __ addptr(rsp, 4 * wordSize);
#ifdef _WIN64
// restore xmm regs belonging to calling function
__ movdqu(xmm6, Address(rsp, 0));
__ movdqu(xmm7, Address(rsp, 2 * wordSize));
__ addptr(rsp, 4 * wordSize);
#endif
__ leave(); __ leave();
__ ret(0); __ ret(0);
@ -3775,22 +3744,6 @@ class StubGenerator: public StubCodeGenerator {
const XMMRegister shuf_mask = xmm8; const XMMRegister shuf_mask = xmm8;
__ enter(); __ enter();
#ifdef _WIN64
// save the xmm registers which must be preserved 6-7
__ subptr(rsp, 6 * wordSize);
__ movdqu(Address(rsp, 0), xmm6);
__ movdqu(Address(rsp, 2 * wordSize), xmm7);
__ movdqu(Address(rsp, 4 * wordSize), xmm8);
if (!VM_Version::supports_sha() && VM_Version::supports_avx2()) {
__ subptr(rsp, 10 * wordSize);
__ movdqu(Address(rsp, 0), xmm9);
__ movdqu(Address(rsp, 2 * wordSize), xmm10);
__ movdqu(Address(rsp, 4 * wordSize), xmm11);
__ movdqu(Address(rsp, 6 * wordSize), xmm12);
__ movdqu(Address(rsp, 8 * wordSize), xmm13);
}
#endif
__ subptr(rsp, 4 * wordSize); __ subptr(rsp, 4 * wordSize);
@ -3802,21 +3755,7 @@ class StubGenerator: public StubCodeGenerator {
buf, state, ofs, limit, rsp, multi_block, shuf_mask); buf, state, ofs, limit, rsp, multi_block, shuf_mask);
} }
__ addptr(rsp, 4 * wordSize); __ addptr(rsp, 4 * wordSize);
#ifdef _WIN64
// restore xmm regs belonging to calling function
if (!VM_Version::supports_sha() && VM_Version::supports_avx2()) {
__ movdqu(xmm9, Address(rsp, 0));
__ movdqu(xmm10, Address(rsp, 2 * wordSize));
__ movdqu(xmm11, Address(rsp, 4 * wordSize));
__ movdqu(xmm12, Address(rsp, 6 * wordSize));
__ movdqu(xmm13, Address(rsp, 8 * wordSize));
__ addptr(rsp, 10 * wordSize);
}
__ movdqu(xmm6, Address(rsp, 0));
__ movdqu(xmm7, Address(rsp, 2 * wordSize));
__ movdqu(xmm8, Address(rsp, 4 * wordSize));
__ addptr(rsp, 6 * wordSize);
#endif
__ leave(); __ leave();
__ ret(0); __ ret(0);
return start; return start;
@ -3917,18 +3856,14 @@ class StubGenerator: public StubCodeGenerator {
} }
#ifdef _WIN64 #ifdef _WIN64
// save the xmm registers which must be preserved 6-14 // allocate spill slots for r13, r14
const int XMM_REG_NUM_KEY_LAST = 14; enum {
__ subptr(rsp, -rsp_after_call_off * wordSize); saved_r13_offset,
for (int i = 6; i <= XMM_REG_NUM_KEY_LAST; i++) { saved_r14_offset
__ movdqu(xmm_save(i), as_XMMRegister(i)); };
} __ subptr(rsp, 2 * wordSize);
__ movptr(Address(rsp, saved_r13_offset * wordSize), r13);
const Address r13_save(rbp, rdi_off * wordSize); __ movptr(Address(rsp, saved_r14_offset * wordSize), r14);
const Address r14_save(rbp, rsi_off * wordSize);
__ movptr(r13_save, r13);
__ movptr(r14_save, r14);
// on win64, fill len_reg from stack position // on win64, fill len_reg from stack position
__ movl(len_reg, len_mem); __ movl(len_reg, len_mem);
@ -4130,13 +4065,10 @@ class StubGenerator: public StubCodeGenerator {
__ movdqu(Address(counter, 0), xmm_curr_counter); //save counter back __ movdqu(Address(counter, 0), xmm_curr_counter); //save counter back
__ pop(rbx); // pop the saved RBX. __ pop(rbx); // pop the saved RBX.
#ifdef _WIN64 #ifdef _WIN64
// restore regs belonging to calling function
for (int i = 6; i <= XMM_REG_NUM_KEY_LAST; i++) {
__ movdqu(as_XMMRegister(i), xmm_save(i));
}
__ movl(rax, len_mem); __ movl(rax, len_mem);
__ movptr(r13, r13_save); __ movptr(r13, Address(rsp, saved_r13_offset * wordSize));
__ movptr(r14, r14_save); __ movptr(r14, Address(rsp, saved_r14_offset * wordSize));
__ addptr(rsp, 2 * wordSize);
#else #else
__ pop(rax); // return 'len' __ pop(rax); // return 'len'
#endif #endif
@ -4177,10 +4109,6 @@ class StubGenerator: public StubCodeGenerator {
const Register data = c_rarg2; const Register data = c_rarg2;
const Register blocks = c_rarg3; const Register blocks = c_rarg3;
#ifdef _WIN64
const int XMM_REG_LAST = 10;
#endif
const XMMRegister xmm_temp0 = xmm0; const XMMRegister xmm_temp0 = xmm0;
const XMMRegister xmm_temp1 = xmm1; const XMMRegister xmm_temp1 = xmm1;
const XMMRegister xmm_temp2 = xmm2; const XMMRegister xmm_temp2 = xmm2;
@ -4203,14 +4131,6 @@ class StubGenerator: public StubCodeGenerator {
__ kmovql(k1, rax); __ kmovql(k1, rax);
} }
#ifdef _WIN64
// save the xmm registers which must be preserved 6-10
__ subptr(rsp, -rsp_after_call_off * wordSize);
for (int i = 6; i <= XMM_REG_LAST; i++) {
__ movdqu(xmm_save(i), as_XMMRegister(i));
}
#endif
__ movdqu(xmm_temp10, ExternalAddress(StubRoutines::x86::ghash_long_swap_mask_addr())); __ movdqu(xmm_temp10, ExternalAddress(StubRoutines::x86::ghash_long_swap_mask_addr()));
__ movdqu(xmm_temp0, Address(state, 0)); __ movdqu(xmm_temp0, Address(state, 0));
@ -4310,12 +4230,6 @@ class StubGenerator: public StubCodeGenerator {
__ pshufb(xmm_temp6, xmm_temp10); // Byte swap 16-byte result __ pshufb(xmm_temp6, xmm_temp10); // Byte swap 16-byte result
__ movdqu(Address(state, 0), xmm_temp6); // store the result __ movdqu(Address(state, 0), xmm_temp6); // store the result
#ifdef _WIN64
// restore xmm regs belonging to calling function
for (int i = 6; i <= XMM_REG_LAST; i++) {
__ movdqu(as_XMMRegister(i), xmm_save(i));
}
#endif
__ leave(); __ leave();
__ ret(0); __ ret(0);
return start; return start;
@ -4652,21 +4566,8 @@ class StubGenerator: public StubCodeGenerator {
BLOCK_COMMENT("Entry:"); BLOCK_COMMENT("Entry:");
__ enter(); // required for proper stackwalking of RuntimeStub frame __ enter(); // required for proper stackwalking of RuntimeStub frame
#ifdef _WIN64
// save the xmm registers which must be preserved 6-7
__ subptr(rsp, 4 * wordSize);
__ movdqu(Address(rsp, 0), xmm6);
__ movdqu(Address(rsp, 2 * wordSize), xmm7);
#endif
__ fast_exp(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp); __ fast_exp(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp);
#ifdef _WIN64
// restore xmm regs belonging to calling function
__ movdqu(xmm6, Address(rsp, 0));
__ movdqu(xmm7, Address(rsp, 2 * wordSize));
__ addptr(rsp, 4 * wordSize);
#endif
__ leave(); // required for proper stackwalking of RuntimeStub frame __ leave(); // required for proper stackwalking of RuntimeStub frame
__ ret(0); __ ret(0);
@ -4693,21 +4594,8 @@ class StubGenerator: public StubCodeGenerator {
BLOCK_COMMENT("Entry:"); BLOCK_COMMENT("Entry:");
__ enter(); // required for proper stackwalking of RuntimeStub frame __ enter(); // required for proper stackwalking of RuntimeStub frame
#ifdef _WIN64
// save the xmm registers which must be preserved 6-7
__ subptr(rsp, 4 * wordSize);
__ movdqu(Address(rsp, 0), xmm6);
__ movdqu(Address(rsp, 2 * wordSize), xmm7);
#endif
__ fast_log(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp1, tmp2); __ fast_log(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp1, tmp2);
#ifdef _WIN64
// restore xmm regs belonging to calling function
__ movdqu(xmm6, Address(rsp, 0));
__ movdqu(xmm7, Address(rsp, 2 * wordSize));
__ addptr(rsp, 4 * wordSize);
#endif
__ leave(); // required for proper stackwalking of RuntimeStub frame __ leave(); // required for proper stackwalking of RuntimeStub frame
__ ret(0); __ ret(0);
@ -4733,21 +4621,8 @@ class StubGenerator: public StubCodeGenerator {
BLOCK_COMMENT("Entry:"); BLOCK_COMMENT("Entry:");
__ enter(); // required for proper stackwalking of RuntimeStub frame __ enter(); // required for proper stackwalking of RuntimeStub frame
#ifdef _WIN64
// save the xmm registers which must be preserved 6-7
__ subptr(rsp, 4 * wordSize);
__ movdqu(Address(rsp, 0), xmm6);
__ movdqu(Address(rsp, 2 * wordSize), xmm7);
#endif
__ fast_log10(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp); __ fast_log10(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp);
#ifdef _WIN64
// restore xmm regs belonging to calling function
__ movdqu(xmm6, Address(rsp, 0));
__ movdqu(xmm7, Address(rsp, 2 * wordSize));
__ addptr(rsp, 4 * wordSize);
#endif
__ leave(); // required for proper stackwalking of RuntimeStub frame __ leave(); // required for proper stackwalking of RuntimeStub frame
__ ret(0); __ ret(0);
@ -4776,21 +4651,8 @@ class StubGenerator: public StubCodeGenerator {
BLOCK_COMMENT("Entry:"); BLOCK_COMMENT("Entry:");
__ enter(); // required for proper stackwalking of RuntimeStub frame __ enter(); // required for proper stackwalking of RuntimeStub frame
#ifdef _WIN64
// save the xmm registers which must be preserved 6-7
__ subptr(rsp, 4 * wordSize);
__ movdqu(Address(rsp, 0), xmm6);
__ movdqu(Address(rsp, 2 * wordSize), xmm7);
#endif
__ fast_pow(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp1, tmp2, tmp3, tmp4); __ fast_pow(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp1, tmp2, tmp3, tmp4);
#ifdef _WIN64
// restore xmm regs belonging to calling function
__ movdqu(xmm6, Address(rsp, 0));
__ movdqu(xmm7, Address(rsp, 2 * wordSize));
__ addptr(rsp, 4 * wordSize);
#endif
__ leave(); // required for proper stackwalking of RuntimeStub frame __ leave(); // required for proper stackwalking of RuntimeStub frame
__ ret(0); __ ret(0);
@ -4822,18 +4684,10 @@ class StubGenerator: public StubCodeGenerator {
#ifdef _WIN64 #ifdef _WIN64
__ push(rsi); __ push(rsi);
__ push(rdi); __ push(rdi);
// save the xmm registers which must be preserved 6-7
__ subptr(rsp, 4 * wordSize);
__ movdqu(Address(rsp, 0), xmm6);
__ movdqu(Address(rsp, 2 * wordSize), xmm7);
#endif #endif
__ fast_sin(x0, x1, x2, x3, x4, x5, x6, x7, rax, rbx, rcx, rdx, tmp1, tmp2, tmp3, tmp4); __ fast_sin(x0, x1, x2, x3, x4, x5, x6, x7, rax, rbx, rcx, rdx, tmp1, tmp2, tmp3, tmp4);
#ifdef _WIN64 #ifdef _WIN64
// restore xmm regs belonging to calling function
__ movdqu(xmm6, Address(rsp, 0));
__ movdqu(xmm7, Address(rsp, 2 * wordSize));
__ addptr(rsp, 4 * wordSize);
__ pop(rdi); __ pop(rdi);
__ pop(rsi); __ pop(rsi);
#endif #endif
@ -4869,18 +4723,10 @@ class StubGenerator: public StubCodeGenerator {
#ifdef _WIN64 #ifdef _WIN64
__ push(rsi); __ push(rsi);
__ push(rdi); __ push(rdi);
// save the xmm registers which must be preserved 6-7
__ subptr(rsp, 4 * wordSize);
__ movdqu(Address(rsp, 0), xmm6);
__ movdqu(Address(rsp, 2 * wordSize), xmm7);
#endif #endif
__ fast_cos(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp1, tmp2, tmp3, tmp4); __ fast_cos(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp1, tmp2, tmp3, tmp4);
#ifdef _WIN64 #ifdef _WIN64
// restore xmm regs belonging to calling function
__ movdqu(xmm6, Address(rsp, 0));
__ movdqu(xmm7, Address(rsp, 2 * wordSize));
__ addptr(rsp, 4 * wordSize);
__ pop(rdi); __ pop(rdi);
__ pop(rsi); __ pop(rsi);
#endif #endif
@ -4916,18 +4762,10 @@ class StubGenerator: public StubCodeGenerator {
#ifdef _WIN64 #ifdef _WIN64
__ push(rsi); __ push(rsi);
__ push(rdi); __ push(rdi);
// save the xmm registers which must be preserved 6-7
__ subptr(rsp, 4 * wordSize);
__ movdqu(Address(rsp, 0), xmm6);
__ movdqu(Address(rsp, 2 * wordSize), xmm7);
#endif #endif
__ fast_tan(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp1, tmp2, tmp3, tmp4); __ fast_tan(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp1, tmp2, tmp3, tmp4);
#ifdef _WIN64 #ifdef _WIN64
// restore xmm regs belonging to calling function
__ movdqu(xmm6, Address(rsp, 0));
__ movdqu(xmm7, Address(rsp, 2 * wordSize));
__ addptr(rsp, 4 * wordSize);
__ pop(rdi); __ pop(rdi);
__ pop(rsi); __ pop(rsi);
#endif #endif

View file

@ -55,7 +55,7 @@
// Run with +PrintInterpreter to get the VM to print out the size. // Run with +PrintInterpreter to get the VM to print out the size.
// Max size with JVMTI // Max size with JVMTI
#ifdef AMD64 #ifdef AMD64
int TemplateInterpreter::InterpreterCodeSize = 256 * 1024; int TemplateInterpreter::InterpreterCodeSize = JVMCI_ONLY(268) NOT_JVMCI(256) * 1024;
#else #else
int TemplateInterpreter::InterpreterCodeSize = 224 * 1024; int TemplateInterpreter::InterpreterCodeSize = 224 * 1024;
#endif // AMD64 #endif // AMD64

View file

@ -341,6 +341,27 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
// [ lo(arg) ] // [ lo(arg) ]
// [ hi(arg) ] // [ hi(arg) ]
// //
if (kind == Interpreter::java_lang_math_fmaD) {
__ movdbl(xmm2, Address(rsp, 5 * wordSize));
__ movdbl(xmm1, Address(rsp, 3 * wordSize));
__ movdbl(xmm0, Address(rsp, 1 * wordSize));
__ fmad(xmm0, xmm1, xmm2, xmm0);
__ pop(rdi); // get return address
__ mov(rsp, rsi); // set sp to sender sp
__ jmp(rdi);
return entry_point;
} else if (kind == Interpreter::java_lang_math_fmaF) {
__ movflt(xmm2, Address(rsp, 3 * wordSize));
__ movflt(xmm1, Address(rsp, 2 * wordSize));
__ movflt(xmm0, Address(rsp, 1 * wordSize));
__ fmaf(xmm0, xmm1, xmm2, xmm0);
__ pop(rdi); // get return address
__ mov(rsp, rsi); // set sp to sender sp
__ jmp(rdi);
return entry_point;
}
__ fld_d(Address(rsp, 1*wordSize)); __ fld_d(Address(rsp, 1*wordSize));
switch (kind) { switch (kind) {

View file

@ -369,8 +369,17 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
// [ hi(arg) ] // [ hi(arg) ]
// //
if (kind == Interpreter::java_lang_math_fmaD) {
if (kind == Interpreter::java_lang_math_sqrt) { __ movdbl(xmm0, Address(rsp, wordSize));
__ movdbl(xmm1, Address(rsp, 3 * wordSize));
__ movdbl(xmm2, Address(rsp, 5 * wordSize));
__ fmad(xmm0, xmm1, xmm2, xmm0);
} else if (kind == Interpreter::java_lang_math_fmaF) {
__ movflt(xmm0, Address(rsp, wordSize));
__ movflt(xmm1, Address(rsp, 2 * wordSize));
__ movflt(xmm2, Address(rsp, 3 * wordSize));
__ fmaf(xmm0, xmm1, xmm2, xmm0);
} else if (kind == Interpreter::java_lang_math_sqrt) {
__ sqrtsd(xmm0, Address(rsp, wordSize)); __ sqrtsd(xmm0, Address(rsp, wordSize));
} else if (kind == Interpreter::java_lang_math_exp) { } else if (kind == Interpreter::java_lang_math_exp) {
__ movdbl(xmm0, Address(rsp, wordSize)); __ movdbl(xmm0, Address(rsp, wordSize));

View file

@ -73,6 +73,7 @@
#define VM_LONG_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ #define VM_LONG_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \
declare_preprocessor_constant("VM_Version::CPU_AVX512BW", CPU_AVX512BW) \ declare_preprocessor_constant("VM_Version::CPU_AVX512BW", CPU_AVX512BW) \
declare_preprocessor_constant("VM_Version::CPU_AVX512VL", CPU_AVX512VL) \ declare_preprocessor_constant("VM_Version::CPU_AVX512VL", CPU_AVX512VL) \
declare_preprocessor_constant("VM_Version::CPU_SHA", CPU_SHA) declare_preprocessor_constant("VM_Version::CPU_SHA", CPU_SHA) \
declare_preprocessor_constant("VM_Version::CPU_FMA", CPU_FMA)
#endif // CPU_X86_VM_VMSTRUCTS_X86_HPP #endif // CPU_X86_VM_VMSTRUCTS_X86_HPP

View file

@ -578,7 +578,7 @@ void VM_Version::get_processor_features() {
} }
char buf[256]; char buf[256];
jio_snprintf(buf, sizeof(buf), "(%u cores per cpu, %u threads per core) family %d model %d stepping %d%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", jio_snprintf(buf, sizeof(buf), "(%u cores per cpu, %u threads per core) family %d model %d stepping %d%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
cores_per_cpu(), threads_per_core(), cores_per_cpu(), threads_per_core(),
cpu_family(), _model, _stepping, cpu_family(), _model, _stepping,
(supports_cmov() ? ", cmov" : ""), (supports_cmov() ? ", cmov" : ""),
@ -610,7 +610,8 @@ void VM_Version::get_processor_features() {
(supports_bmi2() ? ", bmi2" : ""), (supports_bmi2() ? ", bmi2" : ""),
(supports_adx() ? ", adx" : ""), (supports_adx() ? ", adx" : ""),
(supports_evex() ? ", evex" : ""), (supports_evex() ? ", evex" : ""),
(supports_sha() ? ", sha" : "")); (supports_sha() ? ", sha" : ""),
(supports_fma() ? ", fma" : ""));
_features_string = os::strdup(buf); _features_string = os::strdup(buf);
// UseSSE is set to the smaller of what hardware supports and what // UseSSE is set to the smaller of what hardware supports and what
@ -732,6 +733,15 @@ void VM_Version::get_processor_features() {
FLAG_SET_DEFAULT(UseGHASHIntrinsics, false); FLAG_SET_DEFAULT(UseGHASHIntrinsics, false);
} }
if (supports_fma() && UseSSE >= 2) {
if (FLAG_IS_DEFAULT(UseFMA)) {
UseFMA = true;
}
} else if (UseFMA) {
warning("FMA instructions are not available on this CPU");
FLAG_SET_DEFAULT(UseFMA, false);
}
if (supports_sha() LP64_ONLY(|| supports_avx2() && supports_bmi2())) { if (supports_sha() LP64_ONLY(|| supports_avx2() && supports_bmi2())) {
if (FLAG_IS_DEFAULT(UseSHA)) { if (FLAG_IS_DEFAULT(UseSHA)) {
UseSHA = true; UseSHA = true;
@ -773,7 +783,6 @@ void VM_Version::get_processor_features() {
FLAG_SET_DEFAULT(UseAdler32Intrinsics, false); FLAG_SET_DEFAULT(UseAdler32Intrinsics, false);
} }
// Adjust RTM (Restricted Transactional Memory) flags
if (!supports_rtm() && UseRTMLocking) { if (!supports_rtm() && UseRTMLocking) {
// Can't continue because UseRTMLocking affects UseBiasedLocking flag // Can't continue because UseRTMLocking affects UseBiasedLocking flag
// setting during arguments processing. See use_biased_locking(). // setting during arguments processing. See use_biased_locking().

View file

@ -74,7 +74,8 @@ class VM_Version : public Abstract_VM_Version {
: 1, : 1,
ssse3 : 1, ssse3 : 1,
cid : 1, cid : 1,
: 2, : 1,
fma : 1,
cmpxchg16: 1, cmpxchg16: 1,
: 4, : 4,
dca : 1, dca : 1,
@ -289,6 +290,7 @@ protected:
#define CPU_AVX512BW ((uint64_t)UCONST64(0x100000000)) // enums are limited to 31 bit #define CPU_AVX512BW ((uint64_t)UCONST64(0x100000000)) // enums are limited to 31 bit
#define CPU_AVX512VL ((uint64_t)UCONST64(0x200000000)) // EVEX instructions with smaller vector length #define CPU_AVX512VL ((uint64_t)UCONST64(0x200000000)) // EVEX instructions with smaller vector length
#define CPU_SHA ((uint64_t)UCONST64(0x400000000)) // SHA instructions #define CPU_SHA ((uint64_t)UCONST64(0x400000000)) // SHA instructions
#define CPU_FMA ((uint64_t)UCONST64(0x800000000)) // FMA instructions
enum Extended_Family { enum Extended_Family {
// AMD // AMD
@ -522,6 +524,8 @@ protected:
result |= CPU_SHA; result |= CPU_SHA;
if(_cpuid_info.ext_cpuid1_ecx.bits.lzcnt_intel != 0) if(_cpuid_info.ext_cpuid1_ecx.bits.lzcnt_intel != 0)
result |= CPU_LZCNT; result |= CPU_LZCNT;
if (_cpuid_info.std_cpuid1_ecx.bits.fma != 0)
result |= CPU_FMA;
// for Intel, ecx.bits.misalignsse bit (bit 8) indicates support for prefetchw // for Intel, ecx.bits.misalignsse bit (bit 8) indicates support for prefetchw
if (_cpuid_info.ext_cpuid1_ecx.bits.misalignsse != 0) { if (_cpuid_info.ext_cpuid1_ecx.bits.misalignsse != 0) {
result |= CPU_3DNOW_PREFETCH; result |= CPU_3DNOW_PREFETCH;
@ -726,6 +730,7 @@ public:
static bool supports_avx256only() { return (supports_avx2() && !supports_evex()); } static bool supports_avx256only() { return (supports_avx2() && !supports_evex()); }
static bool supports_avxonly() { return ((supports_avx2() || supports_avx()) && !supports_evex()); } static bool supports_avxonly() { return ((supports_avx2() || supports_avx()) && !supports_evex()); }
static bool supports_sha() { return (_features & CPU_SHA) != 0; } static bool supports_sha() { return (_features & CPU_SHA) != 0; }
static bool supports_fma() { return (_features & CPU_FMA) != 0; }
// Intel features // Intel features
static bool is_intel_family_core() { return is_intel() && static bool is_intel_family_core() { return is_intel() &&
extended_cpu_family() == CPU_FAMILY_INTEL_CORE; } extended_cpu_family() == CPU_FAMILY_INTEL_CORE; }

View file

@ -176,451 +176,6 @@ reg_def XMM5n( SOC, SOC, Op_RegF, 5, xmm5->as_VMReg()->next(13));
reg_def XMM5o( SOC, SOC, Op_RegF, 5, xmm5->as_VMReg()->next(14)); reg_def XMM5o( SOC, SOC, Op_RegF, 5, xmm5->as_VMReg()->next(14));
reg_def XMM5p( SOC, SOC, Op_RegF, 5, xmm5->as_VMReg()->next(15)); reg_def XMM5p( SOC, SOC, Op_RegF, 5, xmm5->as_VMReg()->next(15));
#ifdef _WIN64
reg_def XMM6 ( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg());
reg_def XMM6b( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(1));
reg_def XMM6c( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(2));
reg_def XMM6d( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(3));
reg_def XMM6e( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(4));
reg_def XMM6f( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(5));
reg_def XMM6g( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(6));
reg_def XMM6h( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(7));
reg_def XMM6i( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(8));
reg_def XMM6j( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(9));
reg_def XMM6k( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(10));
reg_def XMM6l( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(11));
reg_def XMM6m( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(12));
reg_def XMM6n( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(13));
reg_def XMM6o( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(14));
reg_def XMM6p( SOC, SOE, Op_RegF, 6, xmm6->as_VMReg()->next(15));
reg_def XMM7 ( SOC, SOE, Op_RegF, 7, xmm7->as_VMReg());
reg_def XMM7b( SOC, SOE, Op_RegF, 7, xmm7->as_VMReg()->next(1));
reg_def XMM7c( SOC, SOE, Op_RegF, 7, xmm7->as_VMReg()->next(2));
reg_def XMM7d( SOC, SOE, Op_RegF, 7, xmm7->as_VMReg()->next(3));
reg_def XMM7e( SOC, SOE, Op_RegF, 7, xmm7->as_VMReg()->next(4));
reg_def XMM7f( SOC, SOE, Op_RegF, 7, xmm7->as_VMReg()->next(5));
reg_def XMM7g( SOC, SOE, Op_RegF, 7, xmm7->as_VMReg()->next(6));
reg_def XMM7h( SOC, SOE, Op_RegF, 7, xmm7->as_VMReg()->next(7));
reg_def XMM7i( SOC, SOE, Op_RegF, 7, xmm7->as_VMReg()->next(8));
reg_def XMM7j( SOC, SOE, Op_RegF, 7, xmm7->as_VMReg()->next(9));
reg_def XMM7k( SOC, SOE, Op_RegF, 7, xmm7->as_VMReg()->next(10));
reg_def XMM7l( SOC, SOE, Op_RegF, 7, xmm7->as_VMReg()->next(11));
reg_def XMM7m( SOC, SOE, Op_RegF, 7, xmm7->as_VMReg()->next(12));
reg_def XMM7n( SOC, SOE, Op_RegF, 7, xmm7->as_VMReg()->next(13));
reg_def XMM7o( SOC, SOE, Op_RegF, 7, xmm7->as_VMReg()->next(14));
reg_def XMM7p( SOC, SOE, Op_RegF, 7, xmm7->as_VMReg()->next(15));
reg_def XMM8 ( SOC, SOE, Op_RegF, 8, xmm8->as_VMReg());
reg_def XMM8b( SOC, SOE, Op_RegF, 8, xmm8->as_VMReg()->next(1));
reg_def XMM8c( SOC, SOE, Op_RegF, 8, xmm8->as_VMReg()->next(2));
reg_def XMM8d( SOC, SOE, Op_RegF, 8, xmm8->as_VMReg()->next(3));
reg_def XMM8e( SOC, SOE, Op_RegF, 8, xmm8->as_VMReg()->next(4));
reg_def XMM8f( SOC, SOE, Op_RegF, 8, xmm8->as_VMReg()->next(5));
reg_def XMM8g( SOC, SOE, Op_RegF, 8, xmm8->as_VMReg()->next(6));
reg_def XMM8h( SOC, SOE, Op_RegF, 8, xmm8->as_VMReg()->next(7));
reg_def XMM8i( SOC, SOE, Op_RegF, 8, xmm8->as_VMReg()->next(8));
reg_def XMM8j( SOC, SOE, Op_RegF, 8, xmm8->as_VMReg()->next(9));
reg_def XMM8k( SOC, SOE, Op_RegF, 8, xmm8->as_VMReg()->next(10));
reg_def XMM8l( SOC, SOE, Op_RegF, 8, xmm8->as_VMReg()->next(11));
reg_def XMM8m( SOC, SOE, Op_RegF, 8, xmm8->as_VMReg()->next(12));
reg_def XMM8n( SOC, SOE, Op_RegF, 8, xmm8->as_VMReg()->next(13));
reg_def XMM8o( SOC, SOE, Op_RegF, 8, xmm8->as_VMReg()->next(14));
reg_def XMM8p( SOC, SOE, Op_RegF, 8, xmm8->as_VMReg()->next(15));
reg_def XMM9 ( SOC, SOE, Op_RegF, 9, xmm9->as_VMReg());
reg_def XMM9b( SOC, SOE, Op_RegF, 9, xmm9->as_VMReg()->next(1));
reg_def XMM9c( SOC, SOE, Op_RegF, 9, xmm9->as_VMReg()->next(2));
reg_def XMM9d( SOC, SOE, Op_RegF, 9, xmm9->as_VMReg()->next(3));
reg_def XMM9e( SOC, SOE, Op_RegF, 9, xmm9->as_VMReg()->next(4));
reg_def XMM9f( SOC, SOE, Op_RegF, 9, xmm9->as_VMReg()->next(5));
reg_def XMM9g( SOC, SOE, Op_RegF, 9, xmm9->as_VMReg()->next(6));
reg_def XMM9h( SOC, SOE, Op_RegF, 9, xmm9->as_VMReg()->next(7));
reg_def XMM9i( SOC, SOE, Op_RegF, 9, xmm9->as_VMReg()->next(8));
reg_def XMM9j( SOC, SOE, Op_RegF, 9, xmm9->as_VMReg()->next(9));
reg_def XMM9k( SOC, SOE, Op_RegF, 9, xmm9->as_VMReg()->next(10));
reg_def XMM9l( SOC, SOE, Op_RegF, 9, xmm9->as_VMReg()->next(11));
reg_def XMM9m( SOC, SOE, Op_RegF, 9, xmm9->as_VMReg()->next(12));
reg_def XMM9n( SOC, SOE, Op_RegF, 9, xmm9->as_VMReg()->next(13));
reg_def XMM9o( SOC, SOE, Op_RegF, 9, xmm9->as_VMReg()->next(14));
reg_def XMM9p( SOC, SOE, Op_RegF, 9, xmm9->as_VMReg()->next(15));
reg_def XMM10 ( SOC, SOE, Op_RegF, 10, xmm10->as_VMReg());
reg_def XMM10b( SOC, SOE, Op_RegF, 10, xmm10->as_VMReg()->next(1));
reg_def XMM10c( SOC, SOE, Op_RegF, 10, xmm10->as_VMReg()->next(2));
reg_def XMM10d( SOC, SOE, Op_RegF, 10, xmm10->as_VMReg()->next(3));
reg_def XMM10e( SOC, SOE, Op_RegF, 10, xmm10->as_VMReg()->next(4));
reg_def XMM10f( SOC, SOE, Op_RegF, 10, xmm10->as_VMReg()->next(5));
reg_def XMM10g( SOC, SOE, Op_RegF, 10, xmm10->as_VMReg()->next(6));
reg_def XMM10h( SOC, SOE, Op_RegF, 10, xmm10->as_VMReg()->next(7));
reg_def XMM10i( SOC, SOE, Op_RegF, 10, xmm10->as_VMReg()->next(8));
reg_def XMM10j( SOC, SOE, Op_RegF, 10, xmm10->as_VMReg()->next(9));
reg_def XMM10k( SOC, SOE, Op_RegF, 10, xmm10->as_VMReg()->next(10));
reg_def XMM10l( SOC, SOE, Op_RegF, 10, xmm10->as_VMReg()->next(11));
reg_def XMM10m( SOC, SOE, Op_RegF, 10, xmm10->as_VMReg()->next(12));
reg_def XMM10n( SOC, SOE, Op_RegF, 10, xmm10->as_VMReg()->next(13));
reg_def XMM10o( SOC, SOE, Op_RegF, 10, xmm10->as_VMReg()->next(14));
reg_def XMM10p( SOC, SOE, Op_RegF, 10, xmm10->as_VMReg()->next(15));
reg_def XMM11 ( SOC, SOE, Op_RegF, 11, xmm11->as_VMReg());
reg_def XMM11b( SOC, SOE, Op_RegF, 11, xmm11->as_VMReg()->next(1));
reg_def XMM11c( SOC, SOE, Op_RegF, 11, xmm11->as_VMReg()->next(2));
reg_def XMM11d( SOC, SOE, Op_RegF, 11, xmm11->as_VMReg()->next(3));
reg_def XMM11e( SOC, SOE, Op_RegF, 11, xmm11->as_VMReg()->next(4));
reg_def XMM11f( SOC, SOE, Op_RegF, 11, xmm11->as_VMReg()->next(5));
reg_def XMM11g( SOC, SOE, Op_RegF, 11, xmm11->as_VMReg()->next(6));
reg_def XMM11h( SOC, SOE, Op_RegF, 11, xmm11->as_VMReg()->next(7));
reg_def XMM11i( SOC, SOE, Op_RegF, 11, xmm11->as_VMReg()->next(8));
reg_def XMM11j( SOC, SOE, Op_RegF, 11, xmm11->as_VMReg()->next(9));
reg_def XMM11k( SOC, SOE, Op_RegF, 11, xmm11->as_VMReg()->next(10));
reg_def XMM11l( SOC, SOE, Op_RegF, 11, xmm11->as_VMReg()->next(11));
reg_def XMM11m( SOC, SOE, Op_RegF, 11, xmm11->as_VMReg()->next(12));
reg_def XMM11n( SOC, SOE, Op_RegF, 11, xmm11->as_VMReg()->next(13));
reg_def XMM11o( SOC, SOE, Op_RegF, 11, xmm11->as_VMReg()->next(14));
reg_def XMM11p( SOC, SOE, Op_RegF, 11, xmm11->as_VMReg()->next(15));
reg_def XMM12 ( SOC, SOE, Op_RegF, 12, xmm12->as_VMReg());
reg_def XMM12b( SOC, SOE, Op_RegF, 12, xmm12->as_VMReg()->next(1));
reg_def XMM12c( SOC, SOE, Op_RegF, 12, xmm12->as_VMReg()->next(2));
reg_def XMM12d( SOC, SOE, Op_RegF, 12, xmm12->as_VMReg()->next(3));
reg_def XMM12e( SOC, SOE, Op_RegF, 12, xmm12->as_VMReg()->next(4));
reg_def XMM12f( SOC, SOE, Op_RegF, 12, xmm12->as_VMReg()->next(5));
reg_def XMM12g( SOC, SOE, Op_RegF, 12, xmm12->as_VMReg()->next(6));
reg_def XMM12h( SOC, SOE, Op_RegF, 12, xmm12->as_VMReg()->next(7));
reg_def XMM12i( SOC, SOE, Op_RegF, 12, xmm12->as_VMReg()->next(8));
reg_def XMM12j( SOC, SOE, Op_RegF, 12, xmm12->as_VMReg()->next(9));
reg_def XMM12k( SOC, SOE, Op_RegF, 12, xmm12->as_VMReg()->next(10));
reg_def XMM12l( SOC, SOE, Op_RegF, 12, xmm12->as_VMReg()->next(11));
reg_def XMM12m( SOC, SOE, Op_RegF, 12, xmm12->as_VMReg()->next(12));
reg_def XMM12n( SOC, SOE, Op_RegF, 12, xmm12->as_VMReg()->next(13));
reg_def XMM12o( SOC, SOE, Op_RegF, 12, xmm12->as_VMReg()->next(14));
reg_def XMM12p( SOC, SOE, Op_RegF, 12, xmm12->as_VMReg()->next(15));
reg_def XMM13 ( SOC, SOE, Op_RegF, 13, xmm13->as_VMReg());
reg_def XMM13b( SOC, SOE, Op_RegF, 13, xmm13->as_VMReg()->next(1));
reg_def XMM13c( SOC, SOE, Op_RegF, 13, xmm13->as_VMReg()->next(2));
reg_def XMM13d( SOC, SOE, Op_RegF, 13, xmm13->as_VMReg()->next(3));
reg_def XMM13e( SOC, SOE, Op_RegF, 13, xmm13->as_VMReg()->next(4));
reg_def XMM13f( SOC, SOE, Op_RegF, 13, xmm13->as_VMReg()->next(5));
reg_def XMM13g( SOC, SOE, Op_RegF, 13, xmm13->as_VMReg()->next(6));
reg_def XMM13h( SOC, SOE, Op_RegF, 13, xmm13->as_VMReg()->next(7));
reg_def XMM13i( SOC, SOE, Op_RegF, 13, xmm13->as_VMReg()->next(8));
reg_def XMM13j( SOC, SOE, Op_RegF, 13, xmm13->as_VMReg()->next(9));
reg_def XMM13k( SOC, SOE, Op_RegF, 13, xmm13->as_VMReg()->next(10));
reg_def XMM13l( SOC, SOE, Op_RegF, 13, xmm13->as_VMReg()->next(11));
reg_def XMM13m( SOC, SOE, Op_RegF, 13, xmm13->as_VMReg()->next(12));
reg_def XMM13n( SOC, SOE, Op_RegF, 13, xmm13->as_VMReg()->next(13));
reg_def XMM13o( SOC, SOE, Op_RegF, 13, xmm13->as_VMReg()->next(14));
reg_def XMM13p( SOC, SOE, Op_RegF, 13, xmm13->as_VMReg()->next(15));
reg_def XMM14 ( SOC, SOE, Op_RegF, 14, xmm14->as_VMReg());
reg_def XMM14b( SOC, SOE, Op_RegF, 14, xmm14->as_VMReg()->next(1));
reg_def XMM14c( SOC, SOE, Op_RegF, 14, xmm14->as_VMReg()->next(2));
reg_def XMM14d( SOC, SOE, Op_RegF, 14, xmm14->as_VMReg()->next(3));
reg_def XMM14e( SOC, SOE, Op_RegF, 14, xmm14->as_VMReg()->next(4));
reg_def XMM14f( SOC, SOE, Op_RegF, 14, xmm14->as_VMReg()->next(5));
reg_def XMM14g( SOC, SOE, Op_RegF, 14, xmm14->as_VMReg()->next(6));
reg_def XMM14h( SOC, SOE, Op_RegF, 14, xmm14->as_VMReg()->next(7));
reg_def XMM14i( SOC, SOE, Op_RegF, 14, xmm14->as_VMReg()->next(8));
reg_def XMM14j( SOC, SOE, Op_RegF, 14, xmm14->as_VMReg()->next(9));
reg_def XMM14k( SOC, SOE, Op_RegF, 14, xmm14->as_VMReg()->next(10));
reg_def XMM14l( SOC, SOE, Op_RegF, 14, xmm14->as_VMReg()->next(11));
reg_def XMM14m( SOC, SOE, Op_RegF, 14, xmm14->as_VMReg()->next(12));
reg_def XMM14n( SOC, SOE, Op_RegF, 14, xmm14->as_VMReg()->next(13));
reg_def XMM14o( SOC, SOE, Op_RegF, 14, xmm14->as_VMReg()->next(14));
reg_def XMM14p( SOC, SOE, Op_RegF, 14, xmm14->as_VMReg()->next(15));
reg_def XMM15 ( SOC, SOE, Op_RegF, 15, xmm15->as_VMReg());
reg_def XMM15b( SOC, SOE, Op_RegF, 15, xmm15->as_VMReg()->next(1));
reg_def XMM15c( SOC, SOE, Op_RegF, 15, xmm15->as_VMReg()->next(2));
reg_def XMM15d( SOC, SOE, Op_RegF, 15, xmm15->as_VMReg()->next(3));
reg_def XMM15e( SOC, SOE, Op_RegF, 15, xmm15->as_VMReg()->next(4));
reg_def XMM15f( SOC, SOE, Op_RegF, 15, xmm15->as_VMReg()->next(5));
reg_def XMM15g( SOC, SOE, Op_RegF, 15, xmm15->as_VMReg()->next(6));
reg_def XMM15h( SOC, SOE, Op_RegF, 15, xmm15->as_VMReg()->next(7));
reg_def XMM15i( SOC, SOE, Op_RegF, 15, xmm15->as_VMReg()->next(8));
reg_def XMM15j( SOC, SOE, Op_RegF, 15, xmm15->as_VMReg()->next(9));
reg_def XMM15k( SOC, SOE, Op_RegF, 15, xmm15->as_VMReg()->next(10));
reg_def XMM15l( SOC, SOE, Op_RegF, 15, xmm15->as_VMReg()->next(11));
reg_def XMM15m( SOC, SOE, Op_RegF, 15, xmm15->as_VMReg()->next(12));
reg_def XMM15n( SOC, SOE, Op_RegF, 15, xmm15->as_VMReg()->next(13));
reg_def XMM15o( SOC, SOE, Op_RegF, 15, xmm15->as_VMReg()->next(14));
reg_def XMM15p( SOC, SOE, Op_RegF, 15, xmm15->as_VMReg()->next(15));
reg_def XMM16 ( SOC, SOE, Op_RegF, 16, xmm16->as_VMReg());
reg_def XMM16b( SOC, SOE, Op_RegF, 16, xmm16->as_VMReg()->next(1));
reg_def XMM16c( SOC, SOE, Op_RegF, 16, xmm16->as_VMReg()->next(2));
reg_def XMM16d( SOC, SOE, Op_RegF, 16, xmm16->as_VMReg()->next(3));
reg_def XMM16e( SOC, SOE, Op_RegF, 16, xmm16->as_VMReg()->next(4));
reg_def XMM16f( SOC, SOE, Op_RegF, 16, xmm16->as_VMReg()->next(5));
reg_def XMM16g( SOC, SOE, Op_RegF, 16, xmm16->as_VMReg()->next(6));
reg_def XMM16h( SOC, SOE, Op_RegF, 16, xmm16->as_VMReg()->next(7));
reg_def XMM16i( SOC, SOE, Op_RegF, 16, xmm15->as_VMReg()->next(8));
reg_def XMM16j( SOC, SOE, Op_RegF, 16, xmm16->as_VMReg()->next(9));
reg_def XMM16k( SOC, SOE, Op_RegF, 16, xmm16->as_VMReg()->next(10));
reg_def XMM16l( SOC, SOE, Op_RegF, 16, xmm16->as_VMReg()->next(11));
reg_def XMM16m( SOC, SOE, Op_RegF, 16, xmm16->as_VMReg()->next(12));
reg_def XMM16n( SOC, SOE, Op_RegF, 16, xmm16->as_VMReg()->next(13));
reg_def XMM16o( SOC, SOE, Op_RegF, 16, xmm16->as_VMReg()->next(14));
reg_def XMM16p( SOC, SOE, Op_RegF, 16, xmm16->as_VMReg()->next(15));
reg_def XMM17 ( SOC, SOE, Op_RegF, 17, xmm17->as_VMReg());
reg_def XMM17b( SOC, SOE, Op_RegF, 17, xmm17->as_VMReg()->next(1));
reg_def XMM17c( SOC, SOE, Op_RegF, 17, xmm17->as_VMReg()->next(2));
reg_def XMM17d( SOC, SOE, Op_RegF, 17, xmm17->as_VMReg()->next(3));
reg_def XMM17e( SOC, SOE, Op_RegF, 17, xmm17->as_VMReg()->next(4));
reg_def XMM17f( SOC, SOE, Op_RegF, 17, xmm17->as_VMReg()->next(5));
reg_def XMM17g( SOC, SOE, Op_RegF, 17, xmm17->as_VMReg()->next(6));
reg_def XMM17h( SOC, SOE, Op_RegF, 17, xmm17->as_VMReg()->next(7));
reg_def XMM17i( SOC, SOE, Op_RegF, 17, xmm17->as_VMReg()->next(8));
reg_def XMM17j( SOC, SOE, Op_RegF, 17, xmm17->as_VMReg()->next(9));
reg_def XMM17k( SOC, SOE, Op_RegF, 17, xmm17->as_VMReg()->next(10));
reg_def XMM17l( SOC, SOE, Op_RegF, 17, xmm17->as_VMReg()->next(11));
reg_def XMM17m( SOC, SOE, Op_RegF, 17, xmm17->as_VMReg()->next(12));
reg_def XMM17n( SOC, SOE, Op_RegF, 17, xmm17->as_VMReg()->next(13));
reg_def XMM17o( SOC, SOE, Op_RegF, 17, xmm17->as_VMReg()->next(14));
reg_def XMM17p( SOC, SOE, Op_RegF, 17, xmm17->as_VMReg()->next(15));
reg_def XMM18 ( SOC, SOE, Op_RegF, 18, xmm18->as_VMReg());
reg_def XMM18b( SOC, SOE, Op_RegF, 18, xmm18->as_VMReg()->next(1));
reg_def XMM18c( SOC, SOE, Op_RegF, 18, xmm18->as_VMReg()->next(2));
reg_def XMM18d( SOC, SOE, Op_RegF, 18, xmm18->as_VMReg()->next(3));
reg_def XMM18e( SOC, SOE, Op_RegF, 18, xmm18->as_VMReg()->next(4));
reg_def XMM18f( SOC, SOE, Op_RegF, 18, xmm18->as_VMReg()->next(5));
reg_def XMM18g( SOC, SOE, Op_RegF, 18, xmm18->as_VMReg()->next(6));
reg_def XMM18h( SOC, SOE, Op_RegF, 18, xmm18->as_VMReg()->next(7));
reg_def XMM18i( SOC, SOE, Op_RegF, 18, xmm18->as_VMReg()->next(8));
reg_def XMM18j( SOC, SOE, Op_RegF, 18, xmm18->as_VMReg()->next(9));
reg_def XMM18k( SOC, SOE, Op_RegF, 18, xmm18->as_VMReg()->next(10));
reg_def XMM18l( SOC, SOE, Op_RegF, 18, xmm18->as_VMReg()->next(11));
reg_def XMM18m( SOC, SOE, Op_RegF, 18, xmm18->as_VMReg()->next(12));
reg_def XMM18n( SOC, SOE, Op_RegF, 18, xmm18->as_VMReg()->next(13));
reg_def XMM18o( SOC, SOE, Op_RegF, 18, xmm18->as_VMReg()->next(14));
reg_def XMM18p( SOC, SOE, Op_RegF, 18, xmm18->as_VMReg()->next(15));
reg_def XMM19 ( SOC, SOE, Op_RegF, 19, xmm19->as_VMReg());
reg_def XMM19b( SOC, SOE, Op_RegF, 19, xmm19->as_VMReg()->next(1));
reg_def XMM19c( SOC, SOE, Op_RegF, 19, xmm19->as_VMReg()->next(2));
reg_def XMM19d( SOC, SOE, Op_RegF, 19, xmm19->as_VMReg()->next(3));
reg_def XMM19e( SOC, SOE, Op_RegF, 19, xmm19->as_VMReg()->next(4));
reg_def XMM19f( SOC, SOE, Op_RegF, 19, xmm19->as_VMReg()->next(5));
reg_def XMM19g( SOC, SOE, Op_RegF, 19, xmm19->as_VMReg()->next(6));
reg_def XMM19h( SOC, SOE, Op_RegF, 19, xmm19->as_VMReg()->next(7));
reg_def XMM19i( SOC, SOE, Op_RegF, 19, xmm19->as_VMReg()->next(8));
reg_def XMM19j( SOC, SOE, Op_RegF, 19, xmm19->as_VMReg()->next(9));
reg_def XMM19k( SOC, SOE, Op_RegF, 19, xmm19->as_VMReg()->next(10));
reg_def XMM19l( SOC, SOE, Op_RegF, 19, xmm19->as_VMReg()->next(11));
reg_def XMM19m( SOC, SOE, Op_RegF, 19, xmm19->as_VMReg()->next(12));
reg_def XMM19n( SOC, SOE, Op_RegF, 19, xmm19->as_VMReg()->next(13));
reg_def XMM19o( SOC, SOE, Op_RegF, 19, xmm19->as_VMReg()->next(14));
reg_def XMM19p( SOC, SOE, Op_RegF, 19, xmm19->as_VMReg()->next(15));
reg_def XMM20 ( SOC, SOE, Op_RegF, 20, xmm20->as_VMReg());
reg_def XMM20b( SOC, SOE, Op_RegF, 20, xmm20->as_VMReg()->next(1));
reg_def XMM20c( SOC, SOE, Op_RegF, 20, xmm20->as_VMReg()->next(2));
reg_def XMM20d( SOC, SOE, Op_RegF, 20, xmm20->as_VMReg()->next(3));
reg_def XMM20e( SOC, SOE, Op_RegF, 20, xmm20->as_VMReg()->next(4));
reg_def XMM20f( SOC, SOE, Op_RegF, 20, xmm20->as_VMReg()->next(5));
reg_def XMM20g( SOC, SOE, Op_RegF, 20, xmm20->as_VMReg()->next(6));
reg_def XMM20h( SOC, SOE, Op_RegF, 20, xmm20->as_VMReg()->next(7));
reg_def XMM20i( SOC, SOE, Op_RegF, 20, xmm20->as_VMReg()->next(8));
reg_def XMM20j( SOC, SOE, Op_RegF, 20, xmm20->as_VMReg()->next(9));
reg_def XMM20k( SOC, SOE, Op_RegF, 20, xmm20->as_VMReg()->next(10));
reg_def XMM20l( SOC, SOE, Op_RegF, 20, xmm20->as_VMReg()->next(11));
reg_def XMM20m( SOC, SOE, Op_RegF, 20, xmm20->as_VMReg()->next(12));
reg_def XMM20n( SOC, SOE, Op_RegF, 20, xmm20->as_VMReg()->next(13));
reg_def XMM20o( SOC, SOE, Op_RegF, 20, xmm20->as_VMReg()->next(14));
reg_def XMM20p( SOC, SOE, Op_RegF, 20, xmm20->as_VMReg()->next(15));
reg_def XMM21 ( SOC, SOE, Op_RegF, 21, xmm21->as_VMReg());
reg_def XMM21b( SOC, SOE, Op_RegF, 21, xmm21->as_VMReg()->next(1));
reg_def XMM21c( SOC, SOE, Op_RegF, 21, xmm21->as_VMReg()->next(2));
reg_def XMM21d( SOC, SOE, Op_RegF, 21, xmm21->as_VMReg()->next(3));
reg_def XMM21e( SOC, SOE, Op_RegF, 21, xmm21->as_VMReg()->next(4));
reg_def XMM21f( SOC, SOE, Op_RegF, 21, xmm21->as_VMReg()->next(5));
reg_def XMM21g( SOC, SOE, Op_RegF, 21, xmm21->as_VMReg()->next(6));
reg_def XMM21h( SOC, SOE, Op_RegF, 21, xmm21->as_VMReg()->next(7));
reg_def XMM21i( SOC, SOE, Op_RegF, 21, xmm21->as_VMReg()->next(8));
reg_def XMM21j( SOC, SOE, Op_RegF, 21, xmm21->as_VMReg()->next(9));
reg_def XMM21k( SOC, SOE, Op_RegF, 21, xmm21->as_VMReg()->next(10));
reg_def XMM21l( SOC, SOE, Op_RegF, 21, xmm21->as_VMReg()->next(11));
reg_def XMM21m( SOC, SOE, Op_RegF, 21, xmm21->as_VMReg()->next(12));
reg_def XMM21n( SOC, SOE, Op_RegF, 21, xmm21->as_VMReg()->next(13));
reg_def XMM21o( SOC, SOE, Op_RegF, 21, xmm21->as_VMReg()->next(14));
reg_def XMM21p( SOC, SOE, Op_RegF, 21, xmm21->as_VMReg()->next(15));
reg_def XMM22 ( SOC, SOE, Op_RegF, 22, xmm22->as_VMReg());
reg_def XMM22b( SOC, SOE, Op_RegF, 22, xmm22->as_VMReg()->next(1));
reg_def XMM22c( SOC, SOE, Op_RegF, 22, xmm22->as_VMReg()->next(2));
reg_def XMM22d( SOC, SOE, Op_RegF, 22, xmm22->as_VMReg()->next(3));
reg_def XMM22e( SOC, SOE, Op_RegF, 22, xmm22->as_VMReg()->next(4));
reg_def XMM22f( SOC, SOE, Op_RegF, 22, xmm22->as_VMReg()->next(5));
reg_def XMM22g( SOC, SOE, Op_RegF, 22, xmm22->as_VMReg()->next(6));
reg_def XMM22h( SOC, SOE, Op_RegF, 22, xmm22->as_VMReg()->next(7));
reg_def XMM22i( SOC, SOE, Op_RegF, 22, xmm22->as_VMReg()->next(8));
reg_def XMM22j( SOC, SOE, Op_RegF, 22, xmm22->as_VMReg()->next(9));
reg_def XMM22k( SOC, SOE, Op_RegF, 22, xmm22->as_VMReg()->next(10));
reg_def XMM22l( SOC, SOE, Op_RegF, 22, xmm22->as_VMReg()->next(11));
reg_def XMM22m( SOC, SOE, Op_RegF, 22, xmm22->as_VMReg()->next(12));
reg_def XMM22n( SOC, SOE, Op_RegF, 22, xmm22->as_VMReg()->next(13));
reg_def XMM22o( SOC, SOE, Op_RegF, 22, xmm22->as_VMReg()->next(14));
reg_def XMM22p( SOC, SOE, Op_RegF, 22, xmm22->as_VMReg()->next(15));
reg_def XMM23 ( SOC, SOE, Op_RegF, 23, xmm23->as_VMReg());
reg_def XMM23b( SOC, SOE, Op_RegF, 23, xmm23->as_VMReg()->next(1));
reg_def XMM23c( SOC, SOE, Op_RegF, 23, xmm23->as_VMReg()->next(2));
reg_def XMM23d( SOC, SOE, Op_RegF, 23, xmm23->as_VMReg()->next(3));
reg_def XMM23e( SOC, SOE, Op_RegF, 23, xmm23->as_VMReg()->next(4));
reg_def XMM23f( SOC, SOE, Op_RegF, 23, xmm23->as_VMReg()->next(5));
reg_def XMM23g( SOC, SOE, Op_RegF, 23, xmm23->as_VMReg()->next(6));
reg_def XMM23h( SOC, SOE, Op_RegF, 23, xmm23->as_VMReg()->next(7));
reg_def XMM23i( SOC, SOE, Op_RegF, 23, xmm23->as_VMReg()->next(8));
reg_def XMM23j( SOC, SOE, Op_RegF, 23, xmm23->as_VMReg()->next(9));
reg_def XMM23k( SOC, SOE, Op_RegF, 23, xmm23->as_VMReg()->next(10));
reg_def XMM23l( SOC, SOE, Op_RegF, 23, xmm23->as_VMReg()->next(11));
reg_def XMM23m( SOC, SOE, Op_RegF, 23, xmm23->as_VMReg()->next(12));
reg_def XMM23n( SOC, SOE, Op_RegF, 23, xmm23->as_VMReg()->next(13));
reg_def XMM23o( SOC, SOE, Op_RegF, 23, xmm23->as_VMReg()->next(14));
reg_def XMM23p( SOC, SOE, Op_RegF, 23, xmm23->as_VMReg()->next(15));
reg_def XMM24 ( SOC, SOE, Op_RegF, 24, xmm24->as_VMReg());
reg_def XMM24b( SOC, SOE, Op_RegF, 24, xmm24->as_VMReg()->next(1));
reg_def XMM24c( SOC, SOE, Op_RegF, 24, xmm24->as_VMReg()->next(2));
reg_def XMM24d( SOC, SOE, Op_RegF, 24, xmm24->as_VMReg()->next(3));
reg_def XMM24e( SOC, SOE, Op_RegF, 24, xmm24->as_VMReg()->next(4));
reg_def XMM24f( SOC, SOE, Op_RegF, 24, xmm24->as_VMReg()->next(5));
reg_def XMM24g( SOC, SOE, Op_RegF, 24, xmm24->as_VMReg()->next(6));
reg_def XMM24h( SOC, SOE, Op_RegF, 24, xmm24->as_VMReg()->next(7));
reg_def XMM24i( SOC, SOE, Op_RegF, 24, xmm24->as_VMReg()->next(8));
reg_def XMM24j( SOC, SOE, Op_RegF, 24, xmm24->as_VMReg()->next(9));
reg_def XMM24k( SOC, SOE, Op_RegF, 24, xmm24->as_VMReg()->next(10));
reg_def XMM24l( SOC, SOE, Op_RegF, 24, xmm24->as_VMReg()->next(11));
reg_def XMM24m( SOC, SOE, Op_RegF, 24, xmm24->as_VMReg()->next(12));
reg_def XMM24n( SOC, SOE, Op_RegF, 24, xmm24->as_VMReg()->next(13));
reg_def XMM24o( SOC, SOE, Op_RegF, 24, xmm24->as_VMReg()->next(14));
reg_def XMM24p( SOC, SOE, Op_RegF, 24, xmm24->as_VMReg()->next(15));
reg_def XMM25 ( SOC, SOE, Op_RegF, 25, xmm25->as_VMReg());
reg_def XMM25b( SOC, SOE, Op_RegF, 25, xmm25->as_VMReg()->next(1));
reg_def XMM25c( SOC, SOE, Op_RegF, 25, xmm25->as_VMReg()->next(2));
reg_def XMM25d( SOC, SOE, Op_RegF, 25, xmm25->as_VMReg()->next(3));
reg_def XMM25e( SOC, SOE, Op_RegF, 25, xmm25->as_VMReg()->next(4));
reg_def XMM25f( SOC, SOE, Op_RegF, 25, xmm25->as_VMReg()->next(5));
reg_def XMM25g( SOC, SOE, Op_RegF, 25, xmm25->as_VMReg()->next(6));
reg_def XMM25h( SOC, SOE, Op_RegF, 25, xmm25->as_VMReg()->next(7));
reg_def XMM25i( SOC, SOE, Op_RegF, 25, xmm25->as_VMReg()->next(8));
reg_def XMM25j( SOC, SOE, Op_RegF, 25, xmm25->as_VMReg()->next(9));
reg_def XMM25k( SOC, SOE, Op_RegF, 25, xmm25->as_VMReg()->next(10));
reg_def XMM25l( SOC, SOE, Op_RegF, 25, xmm25->as_VMReg()->next(11));
reg_def XMM25m( SOC, SOE, Op_RegF, 25, xmm25->as_VMReg()->next(12));
reg_def XMM25n( SOC, SOE, Op_RegF, 25, xmm25->as_VMReg()->next(13));
reg_def XMM25o( SOC, SOE, Op_RegF, 25, xmm25->as_VMReg()->next(14));
reg_def XMM25p( SOC, SOE, Op_RegF, 25, xmm25->as_VMReg()->next(15));
reg_def XMM26 ( SOC, SOE, Op_RegF, 26, xmm26->as_VMReg());
reg_def XMM26b( SOC, SOE, Op_RegF, 26, xmm26->as_VMReg()->next(1));
reg_def XMM26c( SOC, SOE, Op_RegF, 26, xmm26->as_VMReg()->next(2));
reg_def XMM26d( SOC, SOE, Op_RegF, 26, xmm26->as_VMReg()->next(3));
reg_def XMM26e( SOC, SOE, Op_RegF, 26, xmm26->as_VMReg()->next(4));
reg_def XMM26f( SOC, SOE, Op_RegF, 26, xmm26->as_VMReg()->next(5));
reg_def XMM26g( SOC, SOE, Op_RegF, 26, xmm26->as_VMReg()->next(6));
reg_def XMM26h( SOC, SOE, Op_RegF, 26, xmm26->as_VMReg()->next(7));
reg_def XMM26i( SOC, SOE, Op_RegF, 26, xmm26->as_VMReg()->next(8));
reg_def XMM26j( SOC, SOE, Op_RegF, 26, xmm26->as_VMReg()->next(9));
reg_def XMM26k( SOC, SOE, Op_RegF, 26, xmm26->as_VMReg()->next(10));
reg_def XMM26l( SOC, SOE, Op_RegF, 26, xmm26->as_VMReg()->next(11));
reg_def XMM26m( SOC, SOE, Op_RegF, 26, xmm26->as_VMReg()->next(12));
reg_def XMM26n( SOC, SOE, Op_RegF, 26, xmm26->as_VMReg()->next(13));
reg_def XMM26o( SOC, SOE, Op_RegF, 26, xmm26->as_VMReg()->next(14));
reg_def XMM26p( SOC, SOE, Op_RegF, 26, xmm26->as_VMReg()->next(15));
reg_def XMM27g( SOC, SOE, Op_RegF, 27, xmm27->as_VMReg()->next(1));
reg_def XMM27c( SOC, SOE, Op_RegF, 27, xmm27->as_VMReg()->next(2));
reg_def XMM27d( SOC, SOE, Op_RegF, 27, xmm27->as_VMReg()->next(3));
reg_def XMM27e( SOC, SOE, Op_RegF, 27, xmm27->as_VMReg()->next(4));
reg_def XMM27f( SOC, SOE, Op_RegF, 27, xmm27->as_VMReg()->next(5));
reg_def XMM27g( SOC, SOE, Op_RegF, 27, xmm27->as_VMReg()->next(6));
reg_def XMM27h( SOC, SOE, Op_RegF, 27, xmm27->as_VMReg()->next(7));
reg_def XMM27i( SOC, SOE, Op_RegF, 27, xmm27->as_VMReg()->next(8));
reg_def XMM27j( SOC, SOE, Op_RegF, 27, xmm27->as_VMReg()->next(9));
reg_def XMM27k( SOC, SOE, Op_RegF, 27, xmm27->as_VMReg()->next(10));
reg_def XMM27l( SOC, SOE, Op_RegF, 27, xmm27->as_VMReg()->next(11));
reg_def XMM27m( SOC, SOE, Op_RegF, 27, xmm27->as_VMReg()->next(12));
reg_def XMM27n( SOC, SOE, Op_RegF, 27, xmm27->as_VMReg()->next(13));
reg_def XMM27o( SOC, SOE, Op_RegF, 27, xmm27->as_VMReg()->next(14));
reg_def XMM27p( SOC, SOE, Op_RegF, 27, xmm27->as_VMReg()->next(15));
reg_def XMM28 ( SOC, SOE, Op_RegF, 28, xmm28->as_VMReg());
reg_def XMM28b( SOC, SOE, Op_RegF, 28, xmm28->as_VMReg()->next(1));
reg_def XMM28c( SOC, SOE, Op_RegF, 28, xmm28->as_VMReg()->next(2));
reg_def XMM28d( SOC, SOE, Op_RegF, 28, xmm28->as_VMReg()->next(3));
reg_def XMM28e( SOC, SOE, Op_RegF, 28, xmm28->as_VMReg()->next(4));
reg_def XMM28f( SOC, SOE, Op_RegF, 28, xmm28->as_VMReg()->next(5));
reg_def XMM28g( SOC, SOE, Op_RegF, 28, xmm28->as_VMReg()->next(6));
reg_def XMM28h( SOC, SOE, Op_RegF, 28, xmm28->as_VMReg()->next(7));
reg_def XMM28i( SOC, SOE, Op_RegF, 28, xmm28->as_VMReg()->next(8));
reg_def XMM28j( SOC, SOE, Op_RegF, 28, xmm28->as_VMReg()->next(9));
reg_def XMM28k( SOC, SOE, Op_RegF, 28, xmm28->as_VMReg()->next(10));
reg_def XMM28l( SOC, SOE, Op_RegF, 28, xmm28->as_VMReg()->next(11));
reg_def XMM28m( SOC, SOE, Op_RegF, 28, xmm28->as_VMReg()->next(12));
reg_def XMM28n( SOC, SOE, Op_RegF, 28, xmm28->as_VMReg()->next(13));
reg_def XMM28o( SOC, SOE, Op_RegF, 28, xmm28->as_VMReg()->next(14));
reg_def XMM28p( SOC, SOE, Op_RegF, 28, xmm28->as_VMReg()->next(15));
reg_def XMM29 ( SOC, SOE, Op_RegF, 29, xmm29->as_VMReg());
reg_def XMM29b( SOC, SOE, Op_RegF, 29, xmm29->as_VMReg()->next(1));
reg_def XMM29c( SOC, SOE, Op_RegF, 29, xmm29->as_VMReg()->next(2));
reg_def XMM29d( SOC, SOE, Op_RegF, 29, xmm29->as_VMReg()->next(3));
reg_def XMM29e( SOC, SOE, Op_RegF, 29, xmm29->as_VMReg()->next(4));
reg_def XMM29f( SOC, SOE, Op_RegF, 29, xmm29->as_VMReg()->next(5));
reg_def XMM29g( SOC, SOE, Op_RegF, 29, xmm29->as_VMReg()->next(6));
reg_def XMM29h( SOC, SOE, Op_RegF, 29, xmm29->as_VMReg()->next(7));
reg_def XMM29i( SOC, SOE, Op_RegF, 29, xmm29->as_VMReg()->next(8));
reg_def XMM29j( SOC, SOE, Op_RegF, 29, xmm29->as_VMReg()->next(9));
reg_def XMM29k( SOC, SOE, Op_RegF, 29, xmm29->as_VMReg()->next(10));
reg_def XMM29l( SOC, SOE, Op_RegF, 29, xmm29->as_VMReg()->next(11));
reg_def XMM29m( SOC, SOE, Op_RegF, 29, xmm29->as_VMReg()->next(12));
reg_def XMM29n( SOC, SOE, Op_RegF, 29, xmm29->as_VMReg()->next(13));
reg_def XMM29o( SOC, SOE, Op_RegF, 29, xmm29->as_VMReg()->next(14));
reg_def XMM29p( SOC, SOE, Op_RegF, 29, xmm29->as_VMReg()->next(15));
reg_def XMM30 ( SOC, SOE, Op_RegF, 30, xmm30->as_VMReg());
reg_def XMM30b( SOC, SOE, Op_RegF, 30, xmm30->as_VMReg()->next(1));
reg_def XMM30c( SOC, SOE, Op_RegF, 30, xmm30->as_VMReg()->next(2));
reg_def XMM30d( SOC, SOE, Op_RegF, 30, xmm30->as_VMReg()->next(3));
reg_def XMM30e( SOC, SOE, Op_RegF, 30, xmm30->as_VMReg()->next(4));
reg_def XMM30f( SOC, SOE, Op_RegF, 30, xmm30->as_VMReg()->next(5));
reg_def XMM30g( SOC, SOE, Op_RegF, 30, xmm30->as_VMReg()->next(6));
reg_def XMM30h( SOC, SOE, Op_RegF, 30, xmm30->as_VMReg()->next(7));
reg_def XMM30i( SOC, SOE, Op_RegF, 30, xmm30->as_VMReg()->next(8));
reg_def XMM30j( SOC, SOE, Op_RegF, 30, xmm30->as_VMReg()->next(9));
reg_def XMM30k( SOC, SOE, Op_RegF, 30, xmm30->as_VMReg()->next(10));
reg_def XMM30l( SOC, SOE, Op_RegF, 30, xmm30->as_VMReg()->next(11));
reg_def XMM30m( SOC, SOE, Op_RegF, 30, xmm30->as_VMReg()->next(12));
reg_def XMM30n( SOC, SOE, Op_RegF, 30, xmm30->as_VMReg()->next(13));
reg_def XMM30o( SOC, SOE, Op_RegF, 30, xmm30->as_VMReg()->next(14));
reg_def XMM30p( SOC, SOE, Op_RegF, 30, xmm30->as_VMReg()->next(15));
reg_def XMM31 ( SOC, SOE, Op_RegF, 31, xmm31->as_VMReg());
reg_def XMM31b( SOC, SOE, Op_RegF, 31, xmm31->as_VMReg()->next(1));
reg_def XMM31c( SOC, SOE, Op_RegF, 31, xmm31->as_VMReg()->next(2));
reg_def XMM31d( SOC, SOE, Op_RegF, 31, xmm31->as_VMReg()->next(3));
reg_def XMM31e( SOC, SOE, Op_RegF, 31, xmm31->as_VMReg()->next(4));
reg_def XMM31f( SOC, SOE, Op_RegF, 31, xmm31->as_VMReg()->next(5));
reg_def XMM31g( SOC, SOE, Op_RegF, 31, xmm31->as_VMReg()->next(6));
reg_def XMM31h( SOC, SOE, Op_RegF, 31, xmm31>-as_VMReg()->next(7));
reg_def XMM31i( SOC, SOE, Op_RegF, 31, xmm31->as_VMReg()->next(8));
reg_def XMM31j( SOC, SOE, Op_RegF, 31, xmm31->as_VMReg()->next(9));
reg_def XMM31k( SOC, SOE, Op_RegF, 31, xmm31->as_VMReg()->next(10));
reg_def XMM31l( SOC, SOE, Op_RegF, 31, xmm31->as_VMReg()->next(11));
reg_def XMM31m( SOC, SOE, Op_RegF, 31, xmm31->as_VMReg()->next(12));
reg_def XMM31n( SOC, SOE, Op_RegF, 31, xmm31->as_VMReg()->next(13));
reg_def XMM31o( SOC, SOE, Op_RegF, 31, xmm31->as_VMReg()->next(14));
reg_def XMM31p( SOC, SOE, Op_RegF, 31, xmm31->as_VMReg()->next(15));
#else // _WIN64
reg_def XMM6 ( SOC, SOC, Op_RegF, 6, xmm6->as_VMReg()); reg_def XMM6 ( SOC, SOC, Op_RegF, 6, xmm6->as_VMReg());
reg_def XMM6b( SOC, SOC, Op_RegF, 6, xmm6->as_VMReg()->next(1)); reg_def XMM6b( SOC, SOC, Op_RegF, 6, xmm6->as_VMReg()->next(1));
reg_def XMM6c( SOC, SOC, Op_RegF, 6, xmm6->as_VMReg()->next(2)); reg_def XMM6c( SOC, SOC, Op_RegF, 6, xmm6->as_VMReg()->next(2));
@ -1067,8 +622,6 @@ reg_def XMM31p( SOC, SOC, Op_RegF, 31, xmm31->as_VMReg()->next(15));
#endif // _LP64 #endif // _LP64
#endif // _WIN64
#ifdef _LP64 #ifdef _LP64
reg_def RFLAGS(SOC, SOC, 0, 16, VMRegImpl::Bad()); reg_def RFLAGS(SOC, SOC, 0, 16, VMRegImpl::Bad());
#else #else
@ -3113,6 +2666,30 @@ instruct onspinwait() %{
ins_pipe(pipe_slow); ins_pipe(pipe_slow);
%} %}
// a * b + c
instruct fmaD_reg(regD a, regD b, regD c) %{
predicate(UseFMA);
match(Set c (FmaD c (Binary a b)));
format %{ "fmasd $a,$b,$c\t# $c = $a * $b + $c" %}
ins_cost(150);
ins_encode %{
__ fmad($c$$XMMRegister, $a$$XMMRegister, $b$$XMMRegister, $c$$XMMRegister);
%}
ins_pipe( pipe_slow );
%}
// a * b + c
instruct fmaF_reg(regF a, regF b, regF c) %{
predicate(UseFMA);
match(Set c (FmaF c (Binary a b)));
format %{ "fmass $a,$b,$c\t# $c = $a * $b + $c" %}
ins_cost(150);
ins_encode %{
__ fmaf($c$$XMMRegister, $a$$XMMRegister, $b$$XMMRegister, $c$$XMMRegister);
%}
ins_pipe( pipe_slow );
%}
// ====================VECTOR INSTRUCTIONS===================================== // ====================VECTOR INSTRUCTIONS=====================================
// Load vectors (4 bytes long) // Load vectors (4 bytes long)

View file

@ -104,14 +104,14 @@ reg_def FPR7H( SOC, SOC, Op_RegF, 7, as_FloatRegister(6)->as_VMReg()->next());
// //
// Empty fill registers, which are never used, but supply alignment to xmm regs // Empty fill registers, which are never used, but supply alignment to xmm regs
// //
reg_def FILL0( SOC, SOC, Op_RegF, 7, as_FloatRegister(6)->as_VMReg()->next(2)); reg_def FILL0( SOC, SOC, Op_RegF, 8, VMRegImpl::Bad());
reg_def FILL1( SOC, SOC, Op_RegF, 7, as_FloatRegister(6)->as_VMReg()->next(3)); reg_def FILL1( SOC, SOC, Op_RegF, 9, VMRegImpl::Bad());
reg_def FILL2( SOC, SOC, Op_RegF, 7, as_FloatRegister(6)->as_VMReg()->next(4)); reg_def FILL2( SOC, SOC, Op_RegF, 10, VMRegImpl::Bad());
reg_def FILL3( SOC, SOC, Op_RegF, 7, as_FloatRegister(6)->as_VMReg()->next(5)); reg_def FILL3( SOC, SOC, Op_RegF, 11, VMRegImpl::Bad());
reg_def FILL4( SOC, SOC, Op_RegF, 7, as_FloatRegister(6)->as_VMReg()->next(6)); reg_def FILL4( SOC, SOC, Op_RegF, 12, VMRegImpl::Bad());
reg_def FILL5( SOC, SOC, Op_RegF, 7, as_FloatRegister(6)->as_VMReg()->next(7)); reg_def FILL5( SOC, SOC, Op_RegF, 13, VMRegImpl::Bad());
reg_def FILL6( SOC, SOC, Op_RegF, 7, as_FloatRegister(6)->as_VMReg()->next(8)); reg_def FILL6( SOC, SOC, Op_RegF, 14, VMRegImpl::Bad());
reg_def FILL7( SOC, SOC, Op_RegF, 7, as_FloatRegister(6)->as_VMReg()->next(9)); reg_def FILL7( SOC, SOC, Op_RegF, 15, VMRegImpl::Bad());
// Specify priority of register selection within phases of register // Specify priority of register selection within phases of register
// allocation. Highest priority is first. A useful heuristic is to // allocation. Highest priority is first. A useful heuristic is to

View file

@ -205,7 +205,8 @@ public class AMD64 extends Architecture {
AVX512CD, AVX512CD,
AVX512BW, AVX512BW,
AVX512VL, AVX512VL,
SHA SHA,
FMA
} }
private final EnumSet<CPUFeature> features; private final EnumSet<CPUFeature> features;

View file

@ -124,6 +124,9 @@ public class AMD64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFacto
if ((config.vmVersionFeatures & config.amd64SHA) != 0) { if ((config.vmVersionFeatures & config.amd64SHA) != 0) {
features.add(AMD64.CPUFeature.SHA); features.add(AMD64.CPUFeature.SHA);
} }
if ((config.vmVersionFeatures & config.amd64FMA) != 0) {
features.add(AMD64.CPUFeature.FMA);
}
return features; return features;
} }

View file

@ -78,4 +78,5 @@ class AMD64HotSpotVMConfig extends HotSpotVMConfigAccess {
final long amd64AVX512BW = getConstant("VM_Version::CPU_AVX512BW", Long.class); final long amd64AVX512BW = getConstant("VM_Version::CPU_AVX512BW", Long.class);
final long amd64AVX512VL = getConstant("VM_Version::CPU_AVX512VL", Long.class); final long amd64AVX512VL = getConstant("VM_Version::CPU_AVX512VL", Long.class);
final long amd64SHA = getConstant("VM_Version::CPU_SHA", Long.class); final long amd64SHA = getConstant("VM_Version::CPU_SHA", Long.class);
final long amd64FMA = getConstant("VM_Version::CPU_FMA", Long.class);
} }

View file

@ -26,8 +26,7 @@ package jdk.vm.ci.hotspot;
import static jdk.vm.ci.common.InitTimer.timer; import static jdk.vm.ci.common.InitTimer.timer;
import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
import java.lang.reflect.Constructor; import java.lang.reflect.Executable;
import java.lang.reflect.Method;
import jdk.vm.ci.code.BytecodeFrame; import jdk.vm.ci.code.BytecodeFrame;
import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.code.InstalledCode;
@ -385,10 +384,9 @@ final class CompilerToVM {
native boolean hasFinalizableSubclass(HotSpotResolvedObjectTypeImpl type); native boolean hasFinalizableSubclass(HotSpotResolvedObjectTypeImpl type);
/** /**
* Gets the method corresponding to {@code holder} and slot number {@code slot} (i.e. * Gets the method corresponding to {@code executable}.
* {@link Method#slot} or {@link Constructor#slot}).
*/ */
native HotSpotResolvedJavaMethodImpl getResolvedJavaMethodAtSlot(Class<?> holder, int slot); native HotSpotResolvedJavaMethodImpl asResolvedJavaMethod(Executable executable);
/** /**
* Gets the maximum absolute offset of a PC relative call to {@code address} from any position * Gets the maximum absolute offset of a PC relative call to {@code address} from any position
@ -616,4 +614,9 @@ final class CompilerToVM {
*/ */
native int interpreterFrameSize(BytecodeFrame frame); native int interpreterFrameSize(BytecodeFrame frame);
/**
* Invokes non-public method {@code java.lang.invoke.LambdaForm.compileToBytecode()} on
* {@code lambdaForm} (which must be a {@code java.lang.invoke.LambdaForm} instance).
*/
native void compileToBytecode(Object lambdaForm);
} }

View file

@ -22,7 +22,7 @@
*/ */
package jdk.vm.ci.hotspot; package jdk.vm.ci.hotspot;
import java.lang.reflect.Field; import java.util.Map;
import jdk.vm.ci.code.BailoutException; import jdk.vm.ci.code.BailoutException;
import jdk.vm.ci.code.BytecodeFrame; import jdk.vm.ci.code.BytecodeFrame;
@ -56,16 +56,11 @@ public class HotSpotCodeCacheProvider implements CodeCacheProvider {
@Override @Override
public String getMarkName(Mark mark) { public String getMarkName(Mark mark) {
int markId = (int) mark.id; int markId = (int) mark.id;
Field[] fields = runtime.getConfig().getClass().getDeclaredFields(); HotSpotVMConfigStore store = runtime.getConfigStore();
for (Field f : fields) { for (Map.Entry<String, Long> e : store.getConstants().entrySet()) {
if (f.getName().startsWith("MARKID_")) { String name = e.getKey();
f.setAccessible(true); if (name.startsWith("MARKID_") && e.getValue() == markId) {
try { return name;
if (f.getInt(runtime.getConfig()) == markId) {
return f.getName();
}
} catch (Exception e) {
}
} }
} }
return CodeCacheProvider.super.getMarkName(mark); return CodeCacheProvider.super.getMarkName(mark);
@ -76,17 +71,13 @@ public class HotSpotCodeCacheProvider implements CodeCacheProvider {
*/ */
@Override @Override
public String getTargetName(Call call) { public String getTargetName(Call call) {
Field[] fields = runtime.getConfig().getClass().getDeclaredFields(); if (call.target instanceof HotSpotForeignCallTarget) {
for (Field f : fields) { long address = ((HotSpotForeignCallTarget) call.target).address;
if (f.getName().endsWith("Stub")) { HotSpotVMConfigStore store = runtime.getConfigStore();
f.setAccessible(true); for (Map.Entry<String, VMField> e : store.getFields().entrySet()) {
Object address; VMField field = e.getValue();
try { if (field.isStatic() && field.value != null && field.value == address) {
address = f.get(runtime.getConfig()); return e.getValue() + ":0x" + Long.toHexString(address);
if (address.equals(call.target)) {
return f.getName() + ":0x" + Long.toHexString((Long) address);
}
} catch (IllegalArgumentException | IllegalAccessException e) {
} }
} }
} }

View file

@ -28,11 +28,10 @@ import static jdk.vm.ci.hotspot.HotSpotResolvedObjectTypeImpl.fromObjectClass;
import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE; import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE;
import java.lang.reflect.Array; import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.Executable; import java.lang.reflect.Executable;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import java.util.Objects;
import jdk.vm.ci.code.CodeUtil; import jdk.vm.ci.code.CodeUtil;
import jdk.vm.ci.code.TargetDescription; import jdk.vm.ci.code.TargetDescription;
@ -78,35 +77,8 @@ public class HotSpotMetaAccessProvider implements MetaAccessProvider {
return new HotSpotSignature(runtime, signature); return new HotSpotSignature(runtime, signature);
} }
/**
* {@link Field} object of {@link Method#slot}.
*/
private Field reflectionMethodSlot = getReflectionSlotField(Method.class);
/**
* {@link Field} object of {@link Constructor#slot}.
*/
private Field reflectionConstructorSlot = getReflectionSlotField(Constructor.class);
private static Field getReflectionSlotField(Class<?> reflectionClass) {
try {
Field field = reflectionClass.getDeclaredField("slot");
field.setAccessible(true);
return field;
} catch (NoSuchFieldException | SecurityException e) {
throw new JVMCIError(e);
}
}
public ResolvedJavaMethod lookupJavaMethod(Executable reflectionMethod) { public ResolvedJavaMethod lookupJavaMethod(Executable reflectionMethod) {
try { return runtime.getCompilerToVM().asResolvedJavaMethod(Objects.requireNonNull(reflectionMethod));
Class<?> holder = reflectionMethod.getDeclaringClass();
Field slotField = reflectionMethod instanceof Constructor ? reflectionConstructorSlot : reflectionMethodSlot;
final int slot = slotField.getInt(reflectionMethod);
return runtime.getCompilerToVM().getResolvedJavaMethodAtSlot(holder, slot);
} catch (IllegalArgumentException | IllegalAccessException e) {
throw new JVMCIError(e);
}
} }
public ResolvedJavaField lookupJavaField(Field reflectionField) { public ResolvedJavaField lookupJavaField(Field reflectionField) {

View file

@ -24,16 +24,17 @@ package jdk.vm.ci.hotspot;
import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM; import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM;
import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
import static jdk.vm.ci.hotspot.HotSpotResolvedObjectTypeImpl.fromObjectClass;
import java.lang.invoke.MethodHandle;
import java.util.Objects;
import jdk.vm.ci.common.JVMCIError; import jdk.vm.ci.common.JVMCIError;
import jdk.vm.ci.meta.ConstantReflectionProvider; import jdk.vm.ci.meta.ConstantReflectionProvider;
import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaConstant;
import jdk.vm.ci.meta.JavaKind;
import jdk.vm.ci.meta.MethodHandleAccessProvider; import jdk.vm.ci.meta.MethodHandleAccessProvider;
import jdk.vm.ci.meta.ResolvedJavaField; import jdk.vm.ci.meta.ResolvedJavaField;
import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaMethod;
import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.ResolvedJavaType;
import jdk.vm.ci.meta.Signature;
public class HotSpotMethodHandleAccessProvider implements MethodHandleAccessProvider { public class HotSpotMethodHandleAccessProvider implements MethodHandleAccessProvider {
@ -48,88 +49,46 @@ public class HotSpotMethodHandleAccessProvider implements MethodHandleAccessProv
* possible after the {@link HotSpotJVMCIRuntime} is fully initialized. * possible after the {@link HotSpotJVMCIRuntime} is fully initialized.
*/ */
static class LazyInitialization { static class LazyInitialization {
static final ResolvedJavaType lambdaFormType;
static final ResolvedJavaField methodHandleFormField; static final ResolvedJavaField methodHandleFormField;
static final ResolvedJavaField lambdaFormVmentryField; static final ResolvedJavaField lambdaFormVmentryField;
static final ResolvedJavaMethod lambdaFormCompileToBytecodeMethod;
static final HotSpotResolvedJavaField memberNameVmtargetField; static final HotSpotResolvedJavaField memberNameVmtargetField;
static final ResolvedJavaType CLASS = fromObjectClass(LazyInitialization.class);
/** /**
* Search for an instance field with the given name in a class. * Search for an instance field with the given name in a class.
* *
* @param className name of the class to search in * @param declaringType the type declaring the field
* @param fieldName name of the field to be searched * @param fieldName name of the field to be searched
* @param fieldType resolved Java type of the field * @param fieldType resolved Java type of the field
* @return resolved Java field * @return resolved Java field
* @throws ClassNotFoundException
* @throws NoSuchFieldError * @throws NoSuchFieldError
*/ */
private static ResolvedJavaField findFieldInClass(String className, String fieldName, ResolvedJavaType fieldType) private static ResolvedJavaField findFieldInClass(ResolvedJavaType declaringType, String fieldName, ResolvedJavaType fieldType) {
throws ClassNotFoundException { ResolvedJavaField[] fields = declaringType.getInstanceFields(false);
Class<?> clazz = Class.forName(className);
ResolvedJavaType type = runtime().fromClass(clazz);
ResolvedJavaField[] fields = type.getInstanceFields(false);
for (ResolvedJavaField field : fields) { for (ResolvedJavaField field : fields) {
if (field.getName().equals(fieldName) && field.getType().equals(fieldType)) { if (field.getName().equals(fieldName) && field.getType().equals(fieldType)) {
return field; return field;
} }
} }
throw new NoSuchFieldError(fieldType.getName() + " " + className + "." + fieldName); throw new NoSuchFieldError(fieldType.getName() + " " + declaringType + "." + fieldName);
} }
private static ResolvedJavaMethod findMethodInClass(String className, String methodName, private static ResolvedJavaType resolveType(Class<?> c) {
ResolvedJavaType resultType, ResolvedJavaType[] parameterTypes) throws ClassNotFoundException { return runtime().fromClass(c);
Class<?> clazz = Class.forName(className);
HotSpotResolvedObjectTypeImpl type = fromObjectClass(clazz);
ResolvedJavaMethod result = null;
for (ResolvedJavaMethod method : type.getDeclaredMethods()) {
if (method.getName().equals(methodName) && signatureMatches(method, resultType, parameterTypes)) {
result = method;
}
}
if (result == null) {
StringBuilder sig = new StringBuilder("(");
for (ResolvedJavaType t : parameterTypes) {
sig.append(t.getName()).append(",");
}
if (sig.length() > 1) {
sig.replace(sig.length() - 1, sig.length(), ")");
} else {
sig.append(')');
}
throw new NoSuchMethodError(resultType.getName() + " " + className + "." + methodName + sig.toString());
}
return result;
} }
private static boolean signatureMatches(ResolvedJavaMethod m, ResolvedJavaType resultType, private static ResolvedJavaType resolveType(String className) throws ClassNotFoundException {
ResolvedJavaType[] parameterTypes) { return resolveType(Class.forName(className));
Signature s = m.getSignature();
if (!s.getReturnType(CLASS).equals(resultType)) {
return false;
}
if (s.getParameterCount(false) != parameterTypes.length) {
return false;
}
for (int i = 0; i < s.getParameterCount(false); ++i) {
if (!s.getParameterType(i, CLASS).equals(parameterTypes[i])) {
return false;
}
}
return true;
} }
static { static {
try { try {
methodHandleFormField = findFieldInClass("java.lang.invoke.MethodHandle", "form", ResolvedJavaType methodHandleType = resolveType(MethodHandle.class);
fromObjectClass(Class.forName("java.lang.invoke.LambdaForm"))); ResolvedJavaType memberNameType = resolveType("java.lang.invoke.MemberName");
lambdaFormVmentryField = findFieldInClass("java.lang.invoke.LambdaForm", "vmentry", lambdaFormType = resolveType("java.lang.invoke.LambdaForm");
fromObjectClass(Class.forName("java.lang.invoke.MemberName"))); methodHandleFormField = findFieldInClass(methodHandleType, "form", lambdaFormType);
lambdaFormCompileToBytecodeMethod = findMethodInClass("java.lang.invoke.LambdaForm", "compileToBytecode", lambdaFormVmentryField = findFieldInClass(lambdaFormType, "vmentry", memberNameType);
new HotSpotResolvedPrimitiveType(JavaKind.Void), new ResolvedJavaType[]{}); memberNameVmtargetField = (HotSpotResolvedJavaField) findFieldInClass(memberNameType, "vmtarget", resolveType(long.class));
memberNameVmtargetField = (HotSpotResolvedJavaField) findFieldInClass("java.lang.invoke.MemberName", "vmtarget",
new HotSpotResolvedPrimitiveType(JavaKind.Long));
} catch (Throwable ex) { } catch (Throwable ex) {
throw new JVMCIError(ex); throw new JVMCIError(ex);
} }
@ -173,12 +132,13 @@ public class HotSpotMethodHandleAccessProvider implements MethodHandleAccessProv
return null; return null;
} }
if (forceBytecodeGeneration) {
/* Invoke non-public method: MemberName LambdaForm.compileToBytecode() */
LazyInitialization.lambdaFormCompileToBytecodeMethod.invoke(lambdaForm, new JavaConstant[0]);
}
/* Load non-public field: MemberName LambdaForm.vmentry */
JavaConstant memberName = constantReflection.readFieldValue(LazyInitialization.lambdaFormVmentryField, lambdaForm); JavaConstant memberName = constantReflection.readFieldValue(LazyInitialization.lambdaFormVmentryField, lambdaForm);
if (memberName.isNull() && forceBytecodeGeneration) {
Object lf = ((HotSpotObjectConstant) lambdaForm).asObject(LazyInitialization.lambdaFormType);
compilerToVM().compileToBytecode(Objects.requireNonNull(lf));
memberName = constantReflection.readFieldValue(LazyInitialization.lambdaFormVmentryField, lambdaForm);
assert memberName.isNonNull();
}
return getTargetMethod(memberName); return getTargetMethod(memberName);
} }
@ -200,4 +160,3 @@ public class HotSpotMethodHandleAccessProvider implements MethodHandleAccessProv
return compilerToVM().getResolvedJavaMethod(object, LazyInitialization.memberNameVmtargetField.offset()); return compilerToVM().getResolvedJavaMethod(object, LazyInitialization.memberNameVmtargetField.offset());
} }
} }

View file

@ -0,0 +1,66 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.vm.ci.hotspot;
import static java.lang.reflect.Modifier.ABSTRACT;
import static java.lang.reflect.Modifier.FINAL;
import static java.lang.reflect.Modifier.INTERFACE;
import static java.lang.reflect.Modifier.NATIVE;
import static java.lang.reflect.Modifier.PRIVATE;
import static java.lang.reflect.Modifier.PROTECTED;
import static java.lang.reflect.Modifier.PUBLIC;
import static java.lang.reflect.Modifier.STATIC;
import static java.lang.reflect.Modifier.STRICT;
import static java.lang.reflect.Modifier.SYNCHRONIZED;
import static java.lang.reflect.Modifier.TRANSIENT;
import static java.lang.reflect.Modifier.VOLATILE;
import static jdk.vm.ci.hotspot.HotSpotVMConfig.config;
import java.lang.reflect.Modifier;
/**
* The non-public modifiers in {@link Modifier} that need to be retrieved from
* {@link HotSpotVMConfig}.
*/
public class HotSpotModifiers {
// @formatter:off
public static final int ANNOTATION = config().jvmAccAnnotation;
public static final int ENUM = config().jvmAccEnum;
public static final int VARARGS = config().jvmAccVarargs;
public static final int BRIDGE = config().jvmAccBridge;
public static final int SYNTHETIC = config().jvmAccSynthetic;
// @formatter:on
public static int jvmClassModifiers() {
return PUBLIC | FINAL | INTERFACE | ABSTRACT | ANNOTATION | ENUM | SYNTHETIC;
}
public static int jvmMethodModifiers() {
return PUBLIC | PRIVATE | PROTECTED | STATIC | FINAL | SYNCHRONIZED | BRIDGE | VARARGS | NATIVE | ABSTRACT | STRICT | SYNTHETIC;
}
public static int jvmFieldModifiers() {
return PUBLIC | PRIVATE | PROTECTED | STATIC | FINAL | VOLATILE | TRANSIENT | ENUM | SYNTHETIC;
}
}

View file

@ -22,6 +22,7 @@
*/ */
package jdk.vm.ci.hotspot; package jdk.vm.ci.hotspot;
import static jdk.vm.ci.hotspot.HotSpotModifiers.jvmFieldModifiers;
import static jdk.vm.ci.hotspot.HotSpotVMConfig.config; import static jdk.vm.ci.hotspot.HotSpotVMConfig.config;
import java.lang.annotation.Annotation; import java.lang.annotation.Annotation;
@ -29,7 +30,6 @@ import java.lang.reflect.Field;
import jdk.internal.vm.annotation.Stable; import jdk.internal.vm.annotation.Stable;
import jdk.vm.ci.meta.JavaType; import jdk.vm.ci.meta.JavaType;
import jdk.vm.ci.meta.ModifiersProvider;
import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.ResolvedJavaType;
/** /**
@ -81,7 +81,7 @@ class HotSpotResolvedJavaFieldImpl implements HotSpotResolvedJavaField {
@Override @Override
public int getModifiers() { public int getModifiers() {
return modifiers & ModifiersProvider.jvmFieldModifiers(); return modifiers & jvmFieldModifiers();
} }
@Override @Override

View file

@ -24,13 +24,15 @@ package jdk.vm.ci.hotspot;
import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM; import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM;
import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
import static jdk.vm.ci.hotspot.HotSpotModifiers.BRIDGE;
import static jdk.vm.ci.hotspot.HotSpotModifiers.SYNTHETIC;
import static jdk.vm.ci.hotspot.HotSpotModifiers.VARARGS;
import static jdk.vm.ci.hotspot.HotSpotModifiers.jvmMethodModifiers;
import static jdk.vm.ci.hotspot.HotSpotVMConfig.config; import static jdk.vm.ci.hotspot.HotSpotVMConfig.config;
import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE; import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE;
import java.lang.annotation.Annotation; import java.lang.annotation.Annotation;
import java.lang.reflect.Executable; import java.lang.reflect.Executable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.util.HashMap; import java.util.HashMap;
@ -42,13 +44,11 @@ import jdk.vm.ci.meta.Constant;
import jdk.vm.ci.meta.ConstantPool; import jdk.vm.ci.meta.ConstantPool;
import jdk.vm.ci.meta.DefaultProfilingInfo; import jdk.vm.ci.meta.DefaultProfilingInfo;
import jdk.vm.ci.meta.ExceptionHandler; import jdk.vm.ci.meta.ExceptionHandler;
import jdk.vm.ci.meta.JavaConstant;
import jdk.vm.ci.meta.JavaMethod; import jdk.vm.ci.meta.JavaMethod;
import jdk.vm.ci.meta.JavaType; import jdk.vm.ci.meta.JavaType;
import jdk.vm.ci.meta.LineNumberTable; import jdk.vm.ci.meta.LineNumberTable;
import jdk.vm.ci.meta.Local; import jdk.vm.ci.meta.Local;
import jdk.vm.ci.meta.LocalVariableTable; import jdk.vm.ci.meta.LocalVariableTable;
import jdk.vm.ci.meta.ModifiersProvider;
import jdk.vm.ci.meta.ProfilingInfo; import jdk.vm.ci.meta.ProfilingInfo;
import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaMethod;
import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.ResolvedJavaType;
@ -210,7 +210,7 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp
@Override @Override
public int getModifiers() { public int getModifiers() {
return getAllModifiers() & ModifiersProvider.jvmMethodModifiers(); return getAllModifiers() & jvmMethodModifiers();
} }
@Override @Override
@ -490,6 +490,19 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp
return javaMethod == null ? null : javaMethod.getAnnotation(annotationClass); return javaMethod == null ? null : javaMethod.getAnnotation(annotationClass);
} }
public boolean isBridge() {
return (BRIDGE & getModifiers()) != 0;
}
@Override
public boolean isSynthetic() {
return (SYNTHETIC & getModifiers()) != 0;
}
public boolean isVarArgs() {
return (VARARGS & getModifiers()) != 0;
}
public boolean isDefault() { public boolean isDefault() {
if (isConstructor()) { if (isConstructor()) {
return false; return false;
@ -697,27 +710,6 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp
return (getFlags() & config().methodFlagsIntrinsicCandidate) != 0; return (getFlags() & config().methodFlagsIntrinsicCandidate) != 0;
} }
@Override
public JavaConstant invoke(JavaConstant receiver, JavaConstant[] arguments) {
assert !isConstructor();
Method javaMethod = (Method) toJava();
javaMethod.setAccessible(true);
Object[] objArguments = new Object[arguments.length];
for (int i = 0; i < arguments.length; i++) {
objArguments[i] = HotSpotObjectConstantImpl.asBoxedValue(arguments[i]);
}
Object objReceiver = receiver != null && !receiver.isNull() ? ((HotSpotObjectConstantImpl) receiver).object() : null;
try {
Object objResult = javaMethod.invoke(objReceiver, objArguments);
return javaMethod.getReturnType() == void.class ? null : HotSpotObjectConstantImpl.forBoxedValue(getSignature().getReturnKind(), objResult);
} catch (IllegalAccessException | InvocationTargetException ex) {
throw new IllegalArgumentException(ex);
}
}
/** /**
* Allocates a compile id for this method by asking the VM for one. * Allocates a compile id for this method by asking the VM for one.
* *

View file

@ -26,6 +26,7 @@ import static java.util.Objects.requireNonNull;
import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM; import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM;
import static jdk.vm.ci.hotspot.HotSpotConstantPool.isSignaturePolymorphicHolder; import static jdk.vm.ci.hotspot.HotSpotConstantPool.isSignaturePolymorphicHolder;
import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime;
import static jdk.vm.ci.hotspot.HotSpotModifiers.jvmClassModifiers;
import static jdk.vm.ci.hotspot.HotSpotVMConfig.config; import static jdk.vm.ci.hotspot.HotSpotVMConfig.config;
import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE; import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE;
@ -49,7 +50,6 @@ import jdk.vm.ci.meta.Constant;
import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaConstant;
import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.JavaKind;
import jdk.vm.ci.meta.JavaType; import jdk.vm.ci.meta.JavaType;
import jdk.vm.ci.meta.ModifiersProvider;
import jdk.vm.ci.meta.ResolvedJavaField; import jdk.vm.ci.meta.ResolvedJavaField;
import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaMethod;
import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.ResolvedJavaType;
@ -152,7 +152,7 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem
if (isArray()) { if (isArray()) {
return (getElementalType().getModifiers() & (Modifier.PUBLIC | Modifier.PRIVATE | Modifier.PROTECTED)) | Modifier.FINAL | Modifier.ABSTRACT; return (getElementalType().getModifiers() & (Modifier.PUBLIC | Modifier.PRIVATE | Modifier.PROTECTED)) | Modifier.FINAL | Modifier.ABSTRACT;
} else { } else {
return getAccessFlags() & ModifiersProvider.jvmClassModifiers(); return getAccessFlags() & jvmClassModifiers();
} }
} }
@ -507,7 +507,7 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem
synchronized HotSpotResolvedJavaField createField(String fieldName, JavaType type, long offset, int rawFlags) { synchronized HotSpotResolvedJavaField createField(String fieldName, JavaType type, long offset, int rawFlags) {
HotSpotResolvedJavaField result = null; HotSpotResolvedJavaField result = null;
final int flags = rawFlags & ModifiersProvider.jvmFieldModifiers(); final int flags = rawFlags & HotSpotModifiers.jvmFieldModifiers();
final long id = offset + ((long) flags << 32); final long id = offset + ((long) flags << 32);

View file

@ -117,8 +117,12 @@ class HotSpotVMConfig extends HotSpotVMConfigAccess {
final int jvmAccFieldHasGenericSignature = getConstant("JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE", Integer.class); final int jvmAccFieldHasGenericSignature = getConstant("JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE", Integer.class);
final int jvmAccIsCloneableFast = getConstant("JVM_ACC_IS_CLONEABLE_FAST", Integer.class); final int jvmAccIsCloneableFast = getConstant("JVM_ACC_IS_CLONEABLE_FAST", Integer.class);
// Modifier.SYNTHETIC is not public so we get it via vmStructs. // These modifiers are not public in Modifier so we get them via vmStructs.
final int jvmAccSynthetic = getConstant("JVM_ACC_SYNTHETIC", Integer.class); final int jvmAccSynthetic = getConstant("JVM_ACC_SYNTHETIC", Integer.class);
final int jvmAccAnnotation = getConstant("JVM_ACC_ANNOTATION", Integer.class);
final int jvmAccBridge = getConstant("JVM_ACC_BRIDGE", Integer.class);
final int jvmAccVarargs = getConstant("JVM_ACC_VARARGS", Integer.class);
final int jvmAccEnum = getConstant("JVM_ACC_ENUM", Integer.class);
// This is only valid on AMD64. // This is only valid on AMD64.
final int runtimeCallStackSize = getConstant("frame::arg_reg_save_area_bytes", Integer.class, osArch.equals("amd64") ? null : 0); final int runtimeCallStackSize = getConstant("frame::arg_reg_save_area_bytes", Integer.class, osArch.equals("amd64") ? null : 0);

View file

@ -22,8 +22,6 @@
*/ */
package jdk.vm.ci.hotspot; package jdk.vm.ci.hotspot;
import java.lang.reflect.Field;
import jdk.internal.misc.Unsafe; import jdk.internal.misc.Unsafe;
/** /**
@ -31,21 +29,5 @@ import jdk.internal.misc.Unsafe;
*/ */
class UnsafeAccess { class UnsafeAccess {
static final Unsafe UNSAFE = initUnsafe(); static final Unsafe UNSAFE = Unsafe.getUnsafe();
private static Unsafe initUnsafe() {
try {
// Fast path when we are trusted.
return Unsafe.getUnsafe();
} catch (SecurityException se) {
// Slow path when we are not trusted.
try {
Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");
theUnsafe.setAccessible(true);
return (Unsafe) theUnsafe.get(Unsafe.class);
} catch (Exception e) {
throw new RuntimeException("exception while trying to get Unsafe", e);
}
}
}
} }

View file

@ -22,9 +22,6 @@
*/ */
package jdk.vm.ci.meta; package jdk.vm.ci.meta;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
/** /**
* Miscellaneous collection of utility methods used by {@code jdk.vm.ci.meta} and its clients. * Miscellaneous collection of utility methods used by {@code jdk.vm.ci.meta} and its clients.
*/ */
@ -226,17 +223,4 @@ public class MetaUtil {
} }
return obj.getClass().getName() + "@" + System.identityHashCode(obj); return obj.getClass().getName() + "@" + System.identityHashCode(obj);
} }
/**
* Used to lookup constants from {@link Modifier} that are not public (VARARGS, SYNTHETIC etc.).
*/
static int getNonPublicModifierStaticField(String name) {
try {
Field field = Modifier.class.getDeclaredField(name);
field.setAccessible(true);
return field.getInt(null);
} catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
throw new InternalError(e);
}
}
} }

View file

@ -22,18 +22,9 @@
*/ */
package jdk.vm.ci.meta; package jdk.vm.ci.meta;
import static java.lang.reflect.Modifier.ABSTRACT;
import static java.lang.reflect.Modifier.FINAL;
import static java.lang.reflect.Modifier.INTERFACE;
import static java.lang.reflect.Modifier.NATIVE;
import static java.lang.reflect.Modifier.PRIVATE; import static java.lang.reflect.Modifier.PRIVATE;
import static java.lang.reflect.Modifier.PROTECTED; import static java.lang.reflect.Modifier.PROTECTED;
import static java.lang.reflect.Modifier.PUBLIC; import static java.lang.reflect.Modifier.PUBLIC;
import static java.lang.reflect.Modifier.STATIC;
import static java.lang.reflect.Modifier.STRICT;
import static java.lang.reflect.Modifier.SYNCHRONIZED;
import static java.lang.reflect.Modifier.TRANSIENT;
import static java.lang.reflect.Modifier.VOLATILE;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
@ -42,17 +33,9 @@ import java.lang.reflect.Modifier;
* language {@linkplain #getModifiers() modifiers}. * language {@linkplain #getModifiers() modifiers}.
*/ */
public interface ModifiersProvider { public interface ModifiersProvider {
int BRIDGE = MetaUtil.getNonPublicModifierStaticField("BRIDGE");
int VARARGS = MetaUtil.getNonPublicModifierStaticField("VARARGS");
int SYNTHETIC = MetaUtil.getNonPublicModifierStaticField("SYNTHETIC");
int ANNOTATION = MetaUtil.getNonPublicModifierStaticField("ANNOTATION");
int ENUM = MetaUtil.getNonPublicModifierStaticField("ENUM");
int MANDATED = MetaUtil.getNonPublicModifierStaticField("MANDATED");
/** /**
* Returns the Java Virtual Machine modifiers for this element. Note that this can differ from * Returns the modifiers for this element.
* standard Java Reflection modifiers. For example at the JVM level, classes (
* {@link ResolvedJavaType}) can not be private or protected.
*/ */
int getModifiers(); int getModifiers();
@ -161,17 +144,4 @@ public interface ModifiersProvider {
default boolean isConcrete() { default boolean isConcrete() {
return !isAbstract(); return !isAbstract();
} }
static int jvmClassModifiers() {
// no SUPER
return PUBLIC | FINAL | INTERFACE | ABSTRACT | ANNOTATION | ENUM | SYNTHETIC;
}
static int jvmMethodModifiers() {
return PUBLIC | PRIVATE | PROTECTED | STATIC | FINAL | SYNCHRONIZED | BRIDGE | VARARGS | NATIVE | ABSTRACT | STRICT | SYNTHETIC;
}
static int jvmFieldModifiers() {
return PUBLIC | PRIVATE | PROTECTED | STATIC | FINAL | VOLATILE | TRANSIENT | ENUM | SYNTHETIC;
}
} }

View file

@ -26,7 +26,6 @@ import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement; import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Array; import java.lang.reflect.Array;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.Type; import java.lang.reflect.Type;
/** /**
@ -72,14 +71,6 @@ public interface ResolvedJavaMethod extends JavaMethod, InvokeTarget, ModifiersP
*/ */
int getMaxStackSize(); int getMaxStackSize();
/**
* {@inheritDoc}
* <p>
* Only the {@linkplain Modifier#methodModifiers() method flags} specified in the JVM
* specification will be included in the returned mask.
*/
int getModifiers();
default boolean isFinal() { default boolean isFinal() {
return ModifiersProvider.super.isFinalFlagSet(); return ModifiersProvider.super.isFinalFlagSet();
} }
@ -88,9 +79,7 @@ public interface ResolvedJavaMethod extends JavaMethod, InvokeTarget, ModifiersP
* Determines if this method is a synthetic method as defined by the Java Language * Determines if this method is a synthetic method as defined by the Java Language
* Specification. * Specification.
*/ */
default boolean isSynthetic() { boolean isSynthetic();
return (SYNTHETIC & getModifiers()) == SYNTHETIC;
}
/** /**
* Checks that the method is a * Checks that the method is a
@ -99,9 +88,7 @@ public interface ResolvedJavaMethod extends JavaMethod, InvokeTarget, ModifiersP
* *
* @return whether the method is a varargs method * @return whether the method is a varargs method
*/ */
default boolean isVarArgs() { boolean isVarArgs();
return (VARARGS & getModifiers()) == VARARGS;
}
/** /**
* Checks that the method is a * Checks that the method is a
@ -110,9 +97,7 @@ public interface ResolvedJavaMethod extends JavaMethod, InvokeTarget, ModifiersP
* *
* @return whether the method is a bridge method * @return whether the method is a bridge method
*/ */
default boolean isBridge() { boolean isBridge();
return (BRIDGE & getModifiers()) == BRIDGE;
}
/** /**
* Returns {@code true} if this method is a default method; returns {@code false} otherwise. * Returns {@code true} if this method is a default method; returns {@code false} otherwise.
@ -227,18 +212,6 @@ public interface ResolvedJavaMethod extends JavaMethod, InvokeTarget, ModifiersP
*/ */
LocalVariableTable getLocalVariableTable(); LocalVariableTable getLocalVariableTable();
/**
* Invokes the underlying method represented by this object, on the specified object with the
* specified parameters. This method is similar to a reflective method invocation by
* {@link Method#invoke}.
*
* @param receiver The receiver for the invocation, or {@code null} if it is a static method.
* @param arguments The arguments for the invocation.
* @return The value returned by the method invocation, or {@code null} if the return type is
* {@code void}.
*/
JavaConstant invoke(JavaConstant receiver, JavaConstant[] arguments);
/** /**
* Gets the encoding of (that is, a constant representing the value of) this method. * Gets the encoding of (that is, a constant representing the value of) this method.
* *

View file

@ -68,15 +68,6 @@ public interface ResolvedJavaType extends JavaType, ModifiersProvider, Annotated
*/ */
boolean isPrimitive(); boolean isPrimitive();
/**
* {@inheritDoc}
* <p>
* Only the flags specified in the JVM specification will be included in the returned mask. This
* method is identical to {@link Class#getModifiers()} in terms of the value return for this
* type.
*/
int getModifiers();
/* /*
* The setting of the final bit for types is a bit confusing since arrays are marked as final. * The setting of the final bit for types is a bit confusing since arrays are marked as final.
* This method provides a semantically equivalent test that appropriate for types. * This method provides a semantically equivalent test that appropriate for types.

View file

@ -1245,6 +1245,7 @@ bool InstructForm::check_branch_variant(ArchDesc &AD, InstructForm *short_branch
this != short_branch && // Don't match myself this != short_branch && // Don't match myself
!is_short_branch() && // Don't match another short branch variant !is_short_branch() && // Don't match another short branch variant
reduce_result() != NULL && reduce_result() != NULL &&
strstr(_ident, "restoreMask") == NULL && // Don't match side effects
strcmp(reduce_result(), short_branch->reduce_result()) == 0 && strcmp(reduce_result(), short_branch->reduce_result()) == 0 &&
_matrule->equivalent(AD.globalNames(), short_branch->_matrule)) { _matrule->equivalent(AD.globalNames(), short_branch->_matrule)) {
// The instructions are equivalent. // The instructions are equivalent.
@ -4037,6 +4038,8 @@ int MatchRule::is_expensive() const {
strcmp(opType,"EncodeP")==0 || strcmp(opType,"EncodeP")==0 ||
strcmp(opType,"EncodePKlass")==0 || strcmp(opType,"EncodePKlass")==0 ||
strcmp(opType,"DecodeNKlass")==0 || strcmp(opType,"DecodeNKlass")==0 ||
strcmp(opType,"FmaD") == 0 ||
strcmp(opType,"FmaF") == 0 ||
strcmp(opType,"RoundDouble")==0 || strcmp(opType,"RoundDouble")==0 ||
strcmp(opType,"RoundFloat")==0 || strcmp(opType,"RoundFloat")==0 ||
strcmp(opType,"ReverseBytesI")==0 || strcmp(opType,"ReverseBytesI")==0 ||

View file

@ -162,6 +162,8 @@ bool Compiler::is_intrinsic_supported(const methodHandle& method) {
case vmIntrinsics::_dlog10: case vmIntrinsics::_dlog10:
case vmIntrinsics::_dexp: case vmIntrinsics::_dexp:
case vmIntrinsics::_dpow: case vmIntrinsics::_dpow:
case vmIntrinsics::_fmaD:
case vmIntrinsics::_fmaF:
case vmIntrinsics::_getObject: case vmIntrinsics::_getObject:
case vmIntrinsics::_getBoolean: case vmIntrinsics::_getBoolean:
case vmIntrinsics::_getByte: case vmIntrinsics::_getByte:

View file

@ -666,7 +666,9 @@ void LIR_OpVisitState::visit(LIR_Op* op) {
// LIR_Op3 // LIR_Op3
case lir_idiv: case lir_idiv:
case lir_irem: { case lir_irem:
case lir_fmad:
case lir_fmaf: {
assert(op->as_Op3() != NULL, "must be"); assert(op->as_Op3() != NULL, "must be");
LIR_Op3* op3= (LIR_Op3*)op; LIR_Op3* op3= (LIR_Op3*)op;
@ -1663,6 +1665,8 @@ const char * LIR_Op::name() const {
// LIR_Op3 // LIR_Op3
case lir_idiv: s = "idiv"; break; case lir_idiv: s = "idiv"; break;
case lir_irem: s = "irem"; break; case lir_irem: s = "irem"; break;
case lir_fmad: s = "fmad"; break;
case lir_fmaf: s = "fmaf"; break;
// LIR_OpJavaCall // LIR_OpJavaCall
case lir_static_call: s = "static"; break; case lir_static_call: s = "static"; break;
case lir_optvirtual_call: s = "optvirtual"; break; case lir_optvirtual_call: s = "optvirtual"; break;

View file

@ -956,6 +956,8 @@ enum LIR_Code {
, begin_op3 , begin_op3
, lir_idiv , lir_idiv
, lir_irem , lir_irem
, lir_fmad
, lir_fmaf
, end_op3 , end_op3
, begin_opJavaCall , begin_opJavaCall
, lir_static_call , lir_static_call
@ -2149,6 +2151,8 @@ class LIR_List: public CompilationResourceObj {
void abs (LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_abs , from, tmp, to)); } void abs (LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_abs , from, tmp, to)); }
void sqrt(LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_sqrt, from, tmp, to)); } void sqrt(LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_sqrt, from, tmp, to)); }
void fmad(LIR_Opr from, LIR_Opr from1, LIR_Opr from2, LIR_Opr to) { append(new LIR_Op3(lir_fmad, from, from1, from2, to)); }
void fmaf(LIR_Opr from, LIR_Opr from1, LIR_Opr from2, LIR_Opr to) { append(new LIR_Op3(lir_fmaf, from, from1, from2, to)); }
void log10 (LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_log10, from, LIR_OprFact::illegalOpr, to, tmp)); } void log10 (LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_log10, from, LIR_OprFact::illegalOpr, to, tmp)); }
void tan (LIR_Opr from, LIR_Opr to, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_Op2(lir_tan , from, tmp1, to, tmp2)); } void tan (LIR_Opr from, LIR_Opr to, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_Op2(lir_tan , from, tmp1, to, tmp2)); }

View file

@ -3181,6 +3181,9 @@ void LIRGenerator::do_Intrinsic(Intrinsic* x) {
case vmIntrinsics::_dpow : do_MathIntrinsic(x); break; case vmIntrinsics::_dpow : do_MathIntrinsic(x); break;
case vmIntrinsics::_arraycopy: do_ArrayCopy(x); break; case vmIntrinsics::_arraycopy: do_ArrayCopy(x); break;
case vmIntrinsics::_fmaD: do_FmaIntrinsic(x); break;
case vmIntrinsics::_fmaF: do_FmaIntrinsic(x); break;
// java.nio.Buffer.checkIndex // java.nio.Buffer.checkIndex
case vmIntrinsics::_checkIndex: do_NIOCheckIndex(x); break; case vmIntrinsics::_checkIndex: do_NIOCheckIndex(x); break;
@ -3244,14 +3247,14 @@ void LIRGenerator::profile_arguments(ProfileCall* x) {
Bytecodes::Code bc = x->method()->java_code_at_bci(bci); Bytecodes::Code bc = x->method()->java_code_at_bci(bci);
int start = 0; int start = 0;
int stop = data->is_CallTypeData() ? ((ciCallTypeData*)data)->number_of_arguments() : ((ciVirtualCallTypeData*)data)->number_of_arguments(); int stop = data->is_CallTypeData() ? ((ciCallTypeData*)data)->number_of_arguments() : ((ciVirtualCallTypeData*)data)->number_of_arguments();
if (x->inlined() && x->callee()->is_static() && Bytecodes::has_receiver(bc)) { if (x->callee()->is_loaded() && x->callee()->is_static() && Bytecodes::has_receiver(bc)) {
// first argument is not profiled at call (method handle invoke) // first argument is not profiled at call (method handle invoke)
assert(x->method()->raw_code_at_bci(bci) == Bytecodes::_invokehandle, "invokehandle expected"); assert(x->method()->raw_code_at_bci(bci) == Bytecodes::_invokehandle, "invokehandle expected");
start = 1; start = 1;
} }
ciSignature* callee_signature = x->callee()->signature(); ciSignature* callee_signature = x->callee()->signature();
// method handle call to virtual method // method handle call to virtual method
bool has_receiver = x->inlined() && !x->callee()->is_static() && !Bytecodes::has_receiver(bc); bool has_receiver = x->callee()->is_loaded() && !x->callee()->is_static() && !Bytecodes::has_receiver(bc);
ciSignatureStream callee_signature_stream(callee_signature, has_receiver ? x->callee()->holder() : NULL); ciSignatureStream callee_signature_stream(callee_signature, has_receiver ? x->callee()->holder() : NULL);
bool ignored_will_link; bool ignored_will_link;

View file

@ -245,6 +245,7 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure {
void do_isPrimitive(Intrinsic* x); void do_isPrimitive(Intrinsic* x);
void do_getClass(Intrinsic* x); void do_getClass(Intrinsic* x);
void do_currentThread(Intrinsic* x); void do_currentThread(Intrinsic* x);
void do_FmaIntrinsic(Intrinsic* x);
void do_MathIntrinsic(Intrinsic* x); void do_MathIntrinsic(Intrinsic* x);
void do_LibmIntrinsic(Intrinsic* x); void do_LibmIntrinsic(Intrinsic* x);
void do_ArrayCopy(Intrinsic* x); void do_ArrayCopy(Intrinsic* x);

View file

@ -355,6 +355,8 @@ bool vmIntrinsics::preserves_state(vmIntrinsics::ID id) {
case vmIntrinsics::_updateBytesCRC32: case vmIntrinsics::_updateBytesCRC32:
case vmIntrinsics::_updateByteBufferCRC32: case vmIntrinsics::_updateByteBufferCRC32:
case vmIntrinsics::_vectorizedMismatch: case vmIntrinsics::_vectorizedMismatch:
case vmIntrinsics::_fmaD:
case vmIntrinsics::_fmaF:
return true; return true;
default: default:
return false; return false;
@ -388,6 +390,8 @@ bool vmIntrinsics::can_trap(vmIntrinsics::ID id) {
case vmIntrinsics::_updateBytesCRC32: case vmIntrinsics::_updateBytesCRC32:
case vmIntrinsics::_updateByteBufferCRC32: case vmIntrinsics::_updateByteBufferCRC32:
case vmIntrinsics::_vectorizedMismatch: case vmIntrinsics::_vectorizedMismatch:
case vmIntrinsics::_fmaD:
case vmIntrinsics::_fmaF:
return false; return false;
default: default:
return true; return true;
@ -536,6 +540,10 @@ bool vmIntrinsics::is_disabled_by_flags(vmIntrinsics::ID id) {
case vmIntrinsics::_doubleToLongBits: case vmIntrinsics::_doubleToLongBits:
if (!InlineMathNatives) return true; if (!InlineMathNatives) return true;
break; break;
case vmIntrinsics::_fmaD:
case vmIntrinsics::_fmaF:
if (!InlineMathNatives || !UseFMA) return true;
break;
case vmIntrinsics::_arraycopy: case vmIntrinsics::_arraycopy:
if (!InlineArrayCopy) return true; if (!InlineArrayCopy) return true;
break; break;

View file

@ -755,6 +755,8 @@
do_class(java_lang_Math, "java/lang/Math") \ do_class(java_lang_Math, "java/lang/Math") \
do_class(java_lang_StrictMath, "java/lang/StrictMath") \ do_class(java_lang_StrictMath, "java/lang/StrictMath") \
do_signature(double2_double_signature, "(DD)D") \ do_signature(double2_double_signature, "(DD)D") \
do_signature(double3_double_signature, "(DDD)D") \
do_signature(float3_float_signature, "(FFF)F") \
do_signature(int2_int_signature, "(II)I") \ do_signature(int2_int_signature, "(II)I") \
do_signature(long2_long_signature, "(JJ)J") \ do_signature(long2_long_signature, "(JJ)J") \
\ \
@ -770,6 +772,7 @@
do_name(multiplyExact_name,"multiplyExact") \ do_name(multiplyExact_name,"multiplyExact") \
do_name(negateExact_name,"negateExact") \ do_name(negateExact_name,"negateExact") \
do_name(subtractExact_name,"subtractExact") \ do_name(subtractExact_name,"subtractExact") \
do_name(fma_name, "fma") \
\ \
do_intrinsic(_dabs, java_lang_Math, abs_name, double_double_signature, F_S) \ do_intrinsic(_dabs, java_lang_Math, abs_name, double_double_signature, F_S) \
do_intrinsic(_dsin, java_lang_Math, sin_name, double_double_signature, F_S) \ do_intrinsic(_dsin, java_lang_Math, sin_name, double_double_signature, F_S) \
@ -795,6 +798,8 @@
do_intrinsic(_negateExactL, java_lang_Math, negateExact_name, long_long_signature, F_S) \ do_intrinsic(_negateExactL, java_lang_Math, negateExact_name, long_long_signature, F_S) \
do_intrinsic(_subtractExactI, java_lang_Math, subtractExact_name, int2_int_signature, F_S) \ do_intrinsic(_subtractExactI, java_lang_Math, subtractExact_name, int2_int_signature, F_S) \
do_intrinsic(_subtractExactL, java_lang_Math, subtractExact_name, long2_long_signature, F_S) \ do_intrinsic(_subtractExactL, java_lang_Math, subtractExact_name, long2_long_signature, F_S) \
do_intrinsic(_fmaD, java_lang_Math, fma_name, double3_double_signature, F_S) \
do_intrinsic(_fmaF, java_lang_Math, fma_name, float3_float_signature, F_S) \
\ \
do_intrinsic(_floatToRawIntBits, java_lang_Float, floatToRawIntBits_name, float_int_signature, F_S) \ do_intrinsic(_floatToRawIntBits, java_lang_Float, floatToRawIntBits_name, float_int_signature, F_S) \
do_name( floatToRawIntBits_name, "floatToRawIntBits") \ do_name( floatToRawIntBits_name, "floatToRawIntBits") \

View file

@ -194,6 +194,13 @@ AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(methodHandle m)
return java_lang_ref_reference_get; return java_lang_ref_reference_get;
} }
if (UseFMA) {
switch (m->intrinsic_id()) {
case vmIntrinsics::_fmaD: return java_lang_math_fmaD;
case vmIntrinsics::_fmaF: return java_lang_math_fmaF;
}
}
// Accessor method? // Accessor method?
if (m->is_getter()) { if (m->is_getter()) {
// TODO: We should have used ::is_accessor above, but fast accessors in Zero expect only getters. // TODO: We should have used ::is_accessor above, but fast accessors in Zero expect only getters.
@ -281,6 +288,8 @@ void AbstractInterpreter::print_method_kind(MethodKind kind) {
case java_lang_math_sqrt : tty->print("java_lang_math_sqrt" ); break; case java_lang_math_sqrt : tty->print("java_lang_math_sqrt" ); break;
case java_lang_math_log : tty->print("java_lang_math_log" ); break; case java_lang_math_log : tty->print("java_lang_math_log" ); break;
case java_lang_math_log10 : tty->print("java_lang_math_log10" ); break; case java_lang_math_log10 : tty->print("java_lang_math_log10" ); break;
case java_lang_math_fmaD : tty->print("java_lang_math_fmaD" ); break;
case java_lang_math_fmaF : tty->print("java_lang_math_fmaF" ); break;
case java_util_zip_CRC32_update : tty->print("java_util_zip_CRC32_update"); break; case java_util_zip_CRC32_update : tty->print("java_util_zip_CRC32_update"); break;
case java_util_zip_CRC32_updateBytes : tty->print("java_util_zip_CRC32_updateBytes"); break; case java_util_zip_CRC32_updateBytes : tty->print("java_util_zip_CRC32_updateBytes"); break;
case java_util_zip_CRC32_updateByteBuffer : tty->print("java_util_zip_CRC32_updateByteBuffer"); break; case java_util_zip_CRC32_updateByteBuffer : tty->print("java_util_zip_CRC32_updateByteBuffer"); break;

View file

@ -76,6 +76,8 @@ class AbstractInterpreter: AllStatic {
java_lang_math_log10, // implementation of java.lang.Math.log10 (x) java_lang_math_log10, // implementation of java.lang.Math.log10 (x)
java_lang_math_pow, // implementation of java.lang.Math.pow (x,y) java_lang_math_pow, // implementation of java.lang.Math.pow (x,y)
java_lang_math_exp, // implementation of java.lang.Math.exp (x) java_lang_math_exp, // implementation of java.lang.Math.exp (x)
java_lang_math_fmaF, // implementation of java.lang.Math.fma (x, y, z)
java_lang_math_fmaD, // implementation of java.lang.Math.fma (x, y, z)
java_lang_ref_reference_get, // implementation of java.lang.ref.Reference.get() java_lang_ref_reference_get, // implementation of java.lang.ref.Reference.get()
java_util_zip_CRC32_update, // implementation of java.util.zip.CRC32.update() java_util_zip_CRC32_update, // implementation of java.util.zip.CRC32.update()
java_util_zip_CRC32_updateBytes, // implementation of java.util.zip.CRC32.updateBytes() java_util_zip_CRC32_updateBytes, // implementation of java.util.zip.CRC32.updateBytes()

View file

@ -239,6 +239,10 @@ void TemplateInterpreterGenerator::generate_all() {
method_entry(java_lang_math_log10) method_entry(java_lang_math_log10)
method_entry(java_lang_math_exp ) method_entry(java_lang_math_exp )
method_entry(java_lang_math_pow ) method_entry(java_lang_math_pow )
if (UseFMA) {
method_entry(java_lang_math_fmaF)
method_entry(java_lang_math_fmaD)
}
method_entry(java_lang_ref_reference_get) method_entry(java_lang_ref_reference_get)
AbstractInterpreter::initialize_method_handle_entries(); AbstractInterpreter::initialize_method_handle_entries();
@ -445,7 +449,9 @@ address TemplateInterpreterGenerator::generate_method_entry(
case Interpreter::java_lang_math_log10 : // fall thru case Interpreter::java_lang_math_log10 : // fall thru
case Interpreter::java_lang_math_sqrt : // fall thru case Interpreter::java_lang_math_sqrt : // fall thru
case Interpreter::java_lang_math_pow : // fall thru case Interpreter::java_lang_math_pow : // fall thru
case Interpreter::java_lang_math_exp : entry_point = generate_math_entry(kind); break; case Interpreter::java_lang_math_exp : // fall thru
case Interpreter::java_lang_math_fmaD : // fall thru
case Interpreter::java_lang_math_fmaF : entry_point = generate_math_entry(kind); break;
case Interpreter::java_lang_ref_reference_get case Interpreter::java_lang_ref_reference_get
: entry_point = generate_Reference_get_entry(); break; : entry_point = generate_Reference_get_entry(); break;
case Interpreter::java_util_zip_CRC32_update case Interpreter::java_util_zip_CRC32_update

View file

@ -114,11 +114,11 @@ void JVMCICompiler::bootstrap(TRAPS) {
JVMCIRuntime::bootstrap_finished(CHECK); JVMCIRuntime::bootstrap_finished(CHECK);
} }
#define CHECK_ABORT THREAD); \ #define CHECK_EXIT THREAD); \
if (HAS_PENDING_EXCEPTION) { \ if (HAS_PENDING_EXCEPTION) { \
char buf[256]; \ char buf[256]; \
jio_snprintf(buf, 256, "Uncaught exception at %s:%d", __FILE__, __LINE__); \ jio_snprintf(buf, 256, "Uncaught exception at %s:%d", __FILE__, __LINE__); \
JVMCICompiler::abort_on_pending_exception(PENDING_EXCEPTION, buf); \ JVMCICompiler::exit_on_pending_exception(PENDING_EXCEPTION, buf); \
return; \ return; \
} \ } \
(void)(0 (void)(0
@ -133,10 +133,10 @@ void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JV
return; return;
} }
JVMCIRuntime::initialize_well_known_classes(CHECK_ABORT); JVMCIRuntime::initialize_well_known_classes(CHECK_EXIT);
HandleMark hm; HandleMark hm;
Handle receiver = JVMCIRuntime::get_HotSpotJVMCIRuntime(CHECK_ABORT); Handle receiver = JVMCIRuntime::get_HotSpotJVMCIRuntime(CHECK_EXIT);
JavaValue method_result(T_OBJECT); JavaValue method_result(T_OBJECT);
JavaCallArguments args; JavaCallArguments args;
@ -202,23 +202,22 @@ CompLevel JVMCIRuntime::adjust_comp_level(methodHandle method, bool is_osr, Comp
return level; return level;
} }
/** void JVMCICompiler::exit_on_pending_exception(Handle exception, const char* message) {
* Aborts the VM due to an unexpected exception. JavaThread* THREAD = JavaThread::current();
*/
void JVMCICompiler::abort_on_pending_exception(Handle exception, const char* message, bool dump_core) {
Thread* THREAD = Thread::current();
CLEAR_PENDING_EXCEPTION; CLEAR_PENDING_EXCEPTION;
static volatile int report_error = 0;
if (!report_error && Atomic::cmpxchg(1, &report_error, 0) == 0) {
// Only report an error once
tty->print_raw_cr(message);
java_lang_Throwable::java_printStackTrace(exception, THREAD); java_lang_Throwable::java_printStackTrace(exception, THREAD);
} else {
// Allow error reporting thread to print the stack trace.
os::sleep(THREAD, 200, false);
}
// Give other aborting threads to also print their stack traces. before_exit(THREAD);
// This can be very useful when debugging class initialization vm_exit(-1);
// failures.
assert(THREAD->is_Java_thread(), "compiler threads should be Java threads");
const bool interruptible = true;
os::sleep(THREAD, 200, interruptible);
vm_abort(dump_core);
} }
// Compilation entry point for methods // Compilation entry point for methods

View file

@ -47,7 +47,10 @@ private:
static elapsedTimer _codeInstallTimer; static elapsedTimer _codeInstallTimer;
static void abort_on_pending_exception(Handle exception, const char* message, bool dump_core = false); /**
* Exits the VM due to an unexpected exception.
*/
static void exit_on_pending_exception(Handle exception, const char* message);
public: public:
JVMCICompiler(); JVMCICompiler();

View file

@ -473,9 +473,20 @@ C2V_VMENTRY(jlong, getExceptionTableStart, (JNIEnv *, jobject, jobject jvmci_met
return (jlong) (address) method->exception_table_start(); return (jlong) (address) method->exception_table_start();
C2V_END C2V_END
C2V_VMENTRY(jobject, getResolvedJavaMethodAtSlot, (JNIEnv *, jobject, jclass holder_handle, jint slot)) C2V_VMENTRY(jobject, asResolvedJavaMethod, (JNIEnv *, jobject, jobject executable_handle))
oop java_class = JNIHandles::resolve(holder_handle); oop executable = JNIHandles::resolve(executable_handle);
Klass* holder = java_lang_Class::as_Klass(java_class); oop mirror = NULL;
int slot = 0;
if (executable->klass() == SystemDictionary::reflect_Constructor_klass()) {
mirror = java_lang_reflect_Constructor::clazz(executable);
slot = java_lang_reflect_Constructor::slot(executable);
} else {
assert(executable->klass() == SystemDictionary::reflect_Method_klass(), "wrong type");
mirror = java_lang_reflect_Method::clazz(executable);
slot = java_lang_reflect_Method::slot(executable);
}
Klass* holder = java_lang_Class::as_Klass(mirror);
methodHandle method = InstanceKlass::cast(holder)->method_with_idnum(slot); methodHandle method = InstanceKlass::cast(holder)->method_with_idnum(slot);
oop result = CompilerToVM::get_jvmci_method(method, CHECK_NULL); oop result = CompilerToVM::get_jvmci_method(method, CHECK_NULL);
return JNIHandles::make_local(THREAD, result); return JNIHandles::make_local(THREAD, result);
@ -1518,6 +1529,17 @@ C2V_VMENTRY(int, interpreterFrameSize, (JNIEnv*, jobject, jobject bytecode_frame
return size + Deoptimization::last_frame_adjust(0, callee_locals) * BytesPerWord; return size + Deoptimization::last_frame_adjust(0, callee_locals) * BytesPerWord;
C2V_END C2V_END
C2V_VMENTRY(void, compileToBytecode, (JNIEnv*, jobject, jobject lambda_form_handle))
Handle lambda_form = JNIHandles::resolve_non_null(lambda_form_handle);
if (lambda_form->is_a(SystemDictionary::LambdaForm_klass())) {
TempNewSymbol compileToBytecode = SymbolTable::new_symbol("compileToBytecode", CHECK);
JavaValue result(T_VOID);
JavaCalls::call_special(&result, lambda_form, SystemDictionary::LambdaForm_klass(), compileToBytecode, vmSymbols::void_method_signature(), CHECK);
} else {
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
err_msg("Unexpected type: %s", lambda_form->klass()->external_name()));
}
C2V_END
#define CC (char*) /*cast a literal from (const char*)*/ #define CC (char*) /*cast a literal from (const char*)*/
#define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(c2v_ ## f)) #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(c2v_ ## f))
@ -1525,6 +1547,7 @@ C2V_END
#define STRING "Ljava/lang/String;" #define STRING "Ljava/lang/String;"
#define OBJECT "Ljava/lang/Object;" #define OBJECT "Ljava/lang/Object;"
#define CLASS "Ljava/lang/Class;" #define CLASS "Ljava/lang/Class;"
#define EXECUTABLE "Ljava/lang/reflect/Executable;"
#define STACK_TRACE_ELEMENT "Ljava/lang/StackTraceElement;" #define STACK_TRACE_ELEMENT "Ljava/lang/StackTraceElement;"
#define INSTALLED_CODE "Ljdk/vm/ci/code/InstalledCode;" #define INSTALLED_CODE "Ljdk/vm/ci/code/InstalledCode;"
#define TARGET_DESCRIPTION "Ljdk/vm/ci/code/TargetDescription;" #define TARGET_DESCRIPTION "Ljdk/vm/ci/code/TargetDescription;"
@ -1572,7 +1595,7 @@ JNINativeMethod CompilerToVM::methods[] = {
{CC "getClassInitializer", CC "(" HS_RESOLVED_KLASS ")" HS_RESOLVED_METHOD, FN_PTR(getClassInitializer)}, {CC "getClassInitializer", CC "(" HS_RESOLVED_KLASS ")" HS_RESOLVED_METHOD, FN_PTR(getClassInitializer)},
{CC "hasFinalizableSubclass", CC "(" HS_RESOLVED_KLASS ")Z", FN_PTR(hasFinalizableSubclass)}, {CC "hasFinalizableSubclass", CC "(" HS_RESOLVED_KLASS ")Z", FN_PTR(hasFinalizableSubclass)},
{CC "getMaxCallTargetOffset", CC "(J)J", FN_PTR(getMaxCallTargetOffset)}, {CC "getMaxCallTargetOffset", CC "(J)J", FN_PTR(getMaxCallTargetOffset)},
{CC "getResolvedJavaMethodAtSlot", CC "(" CLASS "I)" HS_RESOLVED_METHOD, FN_PTR(getResolvedJavaMethodAtSlot)}, {CC "asResolvedJavaMethod", CC "(" EXECUTABLE ")" HS_RESOLVED_METHOD, FN_PTR(asResolvedJavaMethod)},
{CC "getResolvedJavaMethod", CC "(Ljava/lang/Object;J)" HS_RESOLVED_METHOD, FN_PTR(getResolvedJavaMethod)}, {CC "getResolvedJavaMethod", CC "(Ljava/lang/Object;J)" HS_RESOLVED_METHOD, FN_PTR(getResolvedJavaMethod)},
{CC "getConstantPool", CC "(Ljava/lang/Object;)" HS_CONSTANT_POOL, FN_PTR(getConstantPool)}, {CC "getConstantPool", CC "(Ljava/lang/Object;)" HS_CONSTANT_POOL, FN_PTR(getConstantPool)},
{CC "getResolvedJavaType", CC "(Ljava/lang/Object;JZ)" HS_RESOLVED_KLASS, FN_PTR(getResolvedJavaType)}, {CC "getResolvedJavaType", CC "(Ljava/lang/Object;JZ)" HS_RESOLVED_KLASS, FN_PTR(getResolvedJavaType)},
@ -1599,6 +1622,7 @@ JNINativeMethod CompilerToVM::methods[] = {
{CC "flushDebugOutput", CC "()V", FN_PTR(flushDebugOutput)}, {CC "flushDebugOutput", CC "()V", FN_PTR(flushDebugOutput)},
{CC "methodDataProfileDataSize", CC "(JI)I", FN_PTR(methodDataProfileDataSize)}, {CC "methodDataProfileDataSize", CC "(JI)I", FN_PTR(methodDataProfileDataSize)},
{CC "interpreterFrameSize", CC "(" BYTECODE_FRAME ")I", FN_PTR(interpreterFrameSize)}, {CC "interpreterFrameSize", CC "(" BYTECODE_FRAME ")I", FN_PTR(interpreterFrameSize)},
{CC "compileToBytecode", CC "(" OBJECT ")V", FN_PTR(compileToBytecode)},
}; };
int CompilerToVM::methods_count() { int CompilerToVM::methods_count() {

View file

@ -817,16 +817,6 @@ JVM_ENTRY(void, JVM_RegisterJVMCINatives(JNIEnv *env, jclass c2vmClass))
} }
JVM_END JVM_END
#define CHECK_WARN_ABORT_(message) THREAD); \
if (HAS_PENDING_EXCEPTION) { \
warning(message); \
char buf[512]; \
jio_snprintf(buf, 512, "Uncaught exception at %s:%d", __FILE__, __LINE__); \
JVMCIRuntime::abort_on_pending_exception(PENDING_EXCEPTION, buf); \
return; \
} \
(void)(0
void JVMCIRuntime::shutdown(TRAPS) { void JVMCIRuntime::shutdown(TRAPS) {
if (_HotSpotJVMCIRuntime_instance != NULL) { if (_HotSpotJVMCIRuntime_instance != NULL) {
_shutdown_called = true; _shutdown_called = true;

View file

@ -327,8 +327,11 @@
declare_constant(JVM_ACC_FIELD_INTERNAL) \ declare_constant(JVM_ACC_FIELD_INTERNAL) \
declare_constant(JVM_ACC_FIELD_STABLE) \ declare_constant(JVM_ACC_FIELD_STABLE) \
declare_constant(JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE) \ declare_constant(JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE) \
declare_preprocessor_constant("JVM_ACC_VARARGS", JVM_ACC_VARARGS) \
declare_preprocessor_constant("JVM_ACC_BRIDGE", JVM_ACC_BRIDGE) \
declare_preprocessor_constant("JVM_ACC_ANNOTATION", JVM_ACC_ANNOTATION) \
declare_preprocessor_constant("JVM_ACC_ENUM", JVM_ACC_ENUM) \
declare_preprocessor_constant("JVM_ACC_SYNTHETIC", JVM_ACC_SYNTHETIC) \ declare_preprocessor_constant("JVM_ACC_SYNTHETIC", JVM_ACC_SYNTHETIC) \
declare_preprocessor_constant("JVM_RECOGNIZED_FIELD_MODIFIERS", JVM_RECOGNIZED_FIELD_MODIFIERS) \
\ \
declare_constant(JVM_CONSTANT_Utf8) \ declare_constant(JVM_CONSTANT_Utf8) \
declare_constant(JVM_CONSTANT_Unicode) \ declare_constant(JVM_CONSTANT_Unicode) \
@ -660,7 +663,8 @@
#define VM_LONG_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ #define VM_LONG_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \
declare_preprocessor_constant("VM_Version::CPU_AVX512BW", CPU_AVX512BW) \ declare_preprocessor_constant("VM_Version::CPU_AVX512BW", CPU_AVX512BW) \
declare_preprocessor_constant("VM_Version::CPU_AVX512VL", CPU_AVX512VL) \ declare_preprocessor_constant("VM_Version::CPU_AVX512VL", CPU_AVX512VL) \
declare_preprocessor_constant("VM_Version::CPU_SHA", CPU_SHA) declare_preprocessor_constant("VM_Version::CPU_SHA", CPU_SHA) \
declare_preprocessor_constant("VM_Version::CPU_FMA", CPU_FMA)
#endif #endif

View file

@ -416,6 +416,12 @@ bool C2Compiler::is_intrinsic_supported(const methodHandle& method, bool is_virt
case vmIntrinsics::_onSpinWait: case vmIntrinsics::_onSpinWait:
if (!Matcher::match_rule_supported(Op_OnSpinWait)) return false; if (!Matcher::match_rule_supported(Op_OnSpinWait)) return false;
break; break;
case vmIntrinsics::_fmaD:
if (!UseFMA || !Matcher::match_rule_supported(Op_FmaD)) return false;
break;
case vmIntrinsics::_fmaF:
if (!UseFMA || !Matcher::match_rule_supported(Op_FmaF)) return false;
break;
case vmIntrinsics::_hashCode: case vmIntrinsics::_hashCode:
case vmIntrinsics::_identityHashCode: case vmIntrinsics::_identityHashCode:
case vmIntrinsics::_getClass: case vmIntrinsics::_getClass:

View file

@ -151,6 +151,8 @@ macro(EncodeP)
macro(EncodePKlass) macro(EncodePKlass)
macro(FastLock) macro(FastLock)
macro(FastUnlock) macro(FastUnlock)
macro(FmaD)
macro(FmaF)
macro(Goto) macro(Goto)
macro(Halt) macro(Halt)
macro(HasNegatives) macro(HasNegatives)

View file

@ -320,6 +320,7 @@ class LibraryCallKit : public GraphKit {
bool inline_montgomeryMultiply(); bool inline_montgomeryMultiply();
bool inline_montgomerySquare(); bool inline_montgomerySquare();
bool inline_vectorizedMismatch(); bool inline_vectorizedMismatch();
bool inline_fma(vmIntrinsics::ID id);
bool inline_profileBoolean(); bool inline_profileBoolean();
bool inline_isCompileConstant(); bool inline_isCompileConstant();
@ -829,6 +830,10 @@ bool LibraryCallKit::try_to_inline(int predicate) {
case vmIntrinsics::_hasNegatives: case vmIntrinsics::_hasNegatives:
return inline_hasNegatives(); return inline_hasNegatives();
case vmIntrinsics::_fmaD:
case vmIntrinsics::_fmaF:
return inline_fma(intrinsic_id());
default: default:
// If you get here, it may be that someone has added a new intrinsic // If you get here, it may be that someone has added a new intrinsic
// to the list in vmSymbols.hpp without implementing it here. // to the list in vmSymbols.hpp without implementing it here.
@ -6698,6 +6703,35 @@ Node* LibraryCallKit::inline_digestBase_implCompressMB_predicate(int predicate)
return instof_false; // even if it is NULL return instof_false; // even if it is NULL
} }
//-------------inline_fma-----------------------------------
bool LibraryCallKit::inline_fma(vmIntrinsics::ID id) {
Node *a = NULL;
Node *b = NULL;
Node *c = NULL;
Node* result = NULL;
switch (id) {
case vmIntrinsics::_fmaD:
assert(callee()->signature()->size() == 6, "fma has 3 parameters of size 2 each.");
// no receiver since it is static method
a = round_double_node(argument(0));
b = round_double_node(argument(2));
c = round_double_node(argument(4));
result = _gvn.transform(new FmaDNode(control(), a, b, c));
break;
case vmIntrinsics::_fmaF:
assert(callee()->signature()->size() == 3, "fma has 3 parameters of size 1 each.");
a = argument(0);
b = argument(1);
c = argument(2);
result = _gvn.transform(new FmaFNode(control(), a, b, c));
break;
default:
fatal_unexpected_iid(id); break;
}
set_result(result);
return true;
}
bool LibraryCallKit::inline_profileBoolean() { bool LibraryCallKit::inline_profileBoolean() {
Node* counts = argument(1); Node* counts = argument(1);
const TypeAryPtr* ary = NULL; const TypeAryPtr* ary = NULL;

View file

@ -2117,6 +2117,8 @@ void Matcher::find_shared( Node *n ) {
case Op_StrInflatedCopy: case Op_StrInflatedCopy:
case Op_StrCompressedCopy: case Op_StrCompressedCopy:
case Op_EncodeISOArray: case Op_EncodeISOArray:
case Op_FmaD:
case Op_FmaF:
set_shared(n); // Force result into register (it will be anyways) set_shared(n); // Force result into register (it will be anyways)
break; break;
case Op_ConP: { // Convert pointers above the centerline to NUL case Op_ConP: { // Convert pointers above the centerline to NUL
@ -2305,6 +2307,15 @@ void Matcher::find_shared( Node *n ) {
n->del_req(4); n->del_req(4);
break; break;
} }
case Op_FmaD:
case Op_FmaF: {
// Restructure into a binary tree for Matching.
Node* pair = new BinaryNode(n->in(1), n->in(2));
n->set_req(2, pair);
n->set_req(1, n->in(3));
n->del_req(3);
break;
}
default: default:
break; break;
} }

View file

@ -1343,3 +1343,47 @@ const Type* URShiftLNode::Value(PhaseGVN* phase) const {
return TypeLong::LONG; // Give up return TypeLong::LONG; // Give up
} }
//=============================================================================
//------------------------------Value------------------------------------------
const Type* FmaDNode::Value(PhaseGVN* phase) const {
const Type *t1 = phase->type(in(1));
if (t1 == Type::TOP) return Type::TOP;
if (t1->base() != Type::DoubleCon) return Type::DOUBLE;
const Type *t2 = phase->type(in(2));
if (t2 == Type::TOP) return Type::TOP;
if (t2->base() != Type::DoubleCon) return Type::DOUBLE;
const Type *t3 = phase->type(in(3));
if (t3 == Type::TOP) return Type::TOP;
if (t3->base() != Type::DoubleCon) return Type::DOUBLE;
#ifndef __STDC_IEC_559__
return Type::DOUBLE;
#else
double d1 = t1->getd();
double d2 = t2->getd();
double d3 = t3->getd();
return TypeD::make(fma(d1, d2, d3));
#endif
}
//=============================================================================
//------------------------------Value------------------------------------------
const Type* FmaFNode::Value(PhaseGVN* phase) const {
const Type *t1 = phase->type(in(1));
if (t1 == Type::TOP) return Type::TOP;
if (t1->base() != Type::FloatCon) return Type::FLOAT;
const Type *t2 = phase->type(in(2));
if (t2 == Type::TOP) return Type::TOP;
if (t2->base() != Type::FloatCon) return Type::FLOAT;
const Type *t3 = phase->type(in(3));
if (t3 == Type::TOP) return Type::TOP;
if (t3->base() != Type::FloatCon) return Type::FLOAT;
#ifndef __STDC_IEC_559__
return Type::FLOAT;
#else
float f1 = t1->getf();
float f2 = t2->getf();
float f3 = t3->getf();
return TypeF::make(fma(f1, f2, f3));
#endif
}

View file

@ -263,4 +263,26 @@ public:
virtual uint ideal_reg() const { return Op_RegL; } virtual uint ideal_reg() const { return Op_RegL; }
}; };
//------------------------------FmaDNode--------------------------------------
// fused-multiply-add double
class FmaDNode : public Node {
public:
FmaDNode(Node *c, Node *in1, Node *in2, Node *in3) : Node(c, in1, in2, in3) {}
virtual int Opcode() const;
const Type *bottom_type() const { return Type::DOUBLE; }
virtual uint ideal_reg() const { return Op_RegD; }
virtual const Type* Value(PhaseGVN* phase) const;
};
//------------------------------FmaFNode--------------------------------------
// fused-multiply-add float
class FmaFNode : public Node {
public:
FmaFNode(Node *c, Node *in1, Node *in2, Node *in3) : Node(c, in1, in2, in3) {}
virtual int Opcode() const;
const Type *bottom_type() const { return Type::FLOAT; }
virtual uint ideal_reg() const { return Op_RegF; }
virtual const Type* Value(PhaseGVN* phase) const;
};
#endif // SHARE_VM_OPTO_MULNODE_HPP #endif // SHARE_VM_OPTO_MULNODE_HPP

View file

@ -659,6 +659,9 @@ public:
product(bool, UseAES, false, \ product(bool, UseAES, false, \
"Control whether AES instructions can be used on x86/x64") \ "Control whether AES instructions can be used on x86/x64") \
\ \
product(bool, UseFMA, false, \
"Control whether FMA instructions can be used") \
\
product(bool, UseSHA, false, \ product(bool, UseSHA, false, \
"Control whether SHA instructions can be used " \ "Control whether SHA instructions can be used " \
"on SPARC, on ARM and on x86") \ "on SPARC, on ARM and on x86") \

View file

@ -2103,6 +2103,8 @@ typedef CompactHashtable<Symbol*, char> SymbolCompactHashTable;
declare_c2_type(OverflowAddLNode, OverflowLNode) \ declare_c2_type(OverflowAddLNode, OverflowLNode) \
declare_c2_type(OverflowSubLNode, OverflowLNode) \ declare_c2_type(OverflowSubLNode, OverflowLNode) \
declare_c2_type(OverflowMulLNode, OverflowLNode) \ declare_c2_type(OverflowMulLNode, OverflowLNode) \
declare_c2_type(FmaDNode, Node) \
declare_c2_type(FmaFNode, Node) \
\ \
/*********************/ \ /*********************/ \
/* Adapter Blob Entries */ \ /* Adapter Blob Entries */ \

View file

@ -60,7 +60,6 @@ void InternalVMTests::run() {
run_unit_test(TestBitMap_test); run_unit_test(TestBitMap_test);
run_unit_test(TestResourcehash_test); run_unit_test(TestResourcehash_test);
run_unit_test(ObjectMonitor_test); run_unit_test(ObjectMonitor_test);
run_unit_test(JSON_test);
run_unit_test(Test_log_tag_combinations_limit); run_unit_test(Test_log_tag_combinations_limit);
run_unit_test(Test_logtarget); run_unit_test(Test_logtarget);
run_unit_test(Test_logstream); run_unit_test(Test_logstream);

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -686,286 +686,3 @@ void JSON::error(JSON_ERROR e, const char* format, ...) {
} }
} }
#ifndef PRODUCT
class JSONTest : public JSON {
public:
static void test();
private:
JSONTest(const char* text);
static void test(const char* json, bool valid);
void log(uint level, const char* format, ...) ATTRIBUTE_PRINTF(3, 4);
bool callback(JSON_TYPE t, JSON_VAL* v, uint level);
JSON_TYPE prev;
};
void JSON_test() {
JSONTest::test();
}
void JSONTest::test(const char* text, bool should_pass) {
JSONTest json(text);
if (should_pass) {
assert(json.valid() == true, "failed on a valid json string");
if (VerboseInternalVMTests) {
tty->print_cr("-- json test passed as expected --");
}
} else {
assert(json.valid() == false, "succeeded on an invalid json string");
if (VerboseInternalVMTests) {
tty->print_cr("-- json test failed as expected --");
}
}
}
JSONTest::JSONTest(const char* text) : JSON(text, !VerboseInternalVMTests, tty) {
prev = JSON_NONE;
parse();
}
void JSONTest::test() {
JSONTest::test("{}", true);
JSONTest::test("[]", true);
JSONTest::test(" { } ", true);
JSONTest::test(" [ ] ", true);
JSONTest::test("\"error\"", false);
JSONTest::test("error", false);
JSONTest::test("1", false);
JSONTest::test("1.2", false);
JSONTest::test("true", false);
JSONTest::test("false", false);
JSONTest::test("null", false);
JSONTest::test("[ 1 ]", true);
JSONTest::test("[ 1, ]", true);
JSONTest::test("[ true ]", true);
JSONTest::test("[ true, ]", true);
JSONTest::test("[ false ]", true);
JSONTest::test("[ false, ]", true);
JSONTest::test("[ null ]", true);
JSONTest::test("[ null, ]", true);
JSONTest::test("[ \"\" ]", true);
JSONTest::test("[ \"\", ]", true);
JSONTest::test("[ \"elem1\" ]", true);
JSONTest::test("[ \"elem1\", ]", true);
JSONTest::test("[ \"elem1\", ]", true);
JSONTest::test("[ \"elem1\" ]", true);
JSONTest::test("[ \"elem1\", \"elem2\" ]", true);
JSONTest::test("[ \"elem1\", \"elem2\", ]", true);
JSONTest::test("[ \"elem1\" ] { }", false);
JSONTest::test("[ elem1, \"elem2\" ]", false);
JSONTest::test("[ \"elem1\"", false);
JSONTest::test("[ \"elem1 ]", false);
JSONTest::test("[ \"elem1\", \"elem2\"", false);
JSONTest::test("[ truefoo ]", false);
JSONTest::test("[ falsefoo ]", false);
JSONTest::test("[ nullfoo ]", false);
JSONTest::test("{ key : 1 }", true);
JSONTest::test("{ key : 1, }", true);
JSONTest::test("{ key : true }", true);
JSONTest::test("{ key : true, }", true);
JSONTest::test("{ key : false }", true);
JSONTest::test("{ key : false, }", true);
JSONTest::test("{ key : null }", true);
JSONTest::test("{ key : null, }", true);
JSONTest::test("{ \"\" : \"\" }", true);
JSONTest::test("{ \"\" : \"\", }", true);
JSONTest::test("{ \"key1\" : \"val1\" }", true);
JSONTest::test("{ \"key1\" : \"val1\", }", true);
JSONTest::test("{ \"key1\" : \"val1\", \"key2\" : \"val2\" }", true);
JSONTest::test("{ \"key1\" : \"val1\", \"key2\" : \"val2\", }", true);
JSONTest::test("{ \"key\" : \"val\" } [ \"error\" ]", false);
JSONTest::test("{ \"key\" : \"val\" ", false);
JSONTest::test("/**/ { }", true);
JSONTest::test("/* */ { }", true);
JSONTest::test("/*foo*/ { }", true);
JSONTest::test("/* *foo */ { }", true);
JSONTest::test("/* *foo* */ { }", true);
JSONTest::test("/* /*foo */ { }", true);
JSONTest::test("{ } /* foo */", true);
JSONTest::test("{ } /* foo */ ", true);
JSONTest::test("{ } //", true);
JSONTest::test("{ } // ", true);
JSONTest::test("{ } // foo", true);
JSONTest::test("/* * / { }", false);
JSONTest::test("/ * */ { }", false);
JSONTest::test("// { }", false);
JSONTest::test("/* { } */", false);
JSONTest::test("/* { } */ ", false);
JSONTest::test("/* { } ", false);
JSONTest::test("{ } /* ", false);
JSONTest::test("/* { } *", false);
JSONTest::test("{ /* } */", false);
JSONTest::test("[ /* ] */", false);
JSONTest::test("{ key : \"val\", /* } */", false);
JSONTest::test("[ \"val\", /* ] */", false);
JSONTest::test("/* comment */{ key1 : { \"key2\" : { \"key3\" : [ \"elem1\", \"elem2\", { \"key4\" : null }, 3 , 2 , 1 , 0 , -1 , -2 , -3 , true, false, null, ] }, \"key5\" : true }, \"key6\" : [ \"\" ], key7 : \"val\",}", true);
JSONTest::test("/* comment */ { \"key1\" : { \"key2\" : { \"key3\" : [ \"elem1\", \"elem2\", { \"key4\" : null }, 3 , 2 , 1 , 0 , -1 , -2 , -3 , true, false, null, ] }, \"key5\" : true }, \"key6\" : [ \"\" ], key7 : \"val\",}", true);
JSONTest::test("/*comment*/{\"ff1 fsd\":{\"\":{\"\":[\"\",\"\"]},\"\":true},\"\":[\"\"],\"foo\":\"\",}", true);
JSONTest::test("/* comment */ { key1 error : { \"\" : { \"\" : [ \"\", \"\" ] }, \"\" : true }, \"baz\" : [ \"\" ], foo : \"\",}", false); // first key needs to be quoted since it contains a space
JSONTest::test("[\n]", true);
JSONTest::test(
"[" "\n"
" {"
" // pattern to match against class+method+signature" "\n"
" // leading and trailing wildcard (*) allowed" "\n"
" match: \"foo.bar.*\"," "\n"
" " "\n"
" // override defaults for specified compiler" "\n"
" // we may differentiate between levels too. TBD." "\n"
" c1: {" "\n"
" //override c1 presets " "\n"
" array_bounds_check_removal: false" "\n"
" }," "\n"
"" "\n"
" c2: {" "\n"
" // control inlining of method" "\n"
" // + force inline, - dont inline" "\n"
" inline : [ \"+java.util.*\", \"-com.sun.*\"]," "\n"
" }," "\n"
"" "\n"
" // directives outside a specific preset applies to all compilers" "\n"
" inline : [ \"+java.util.*\", \"-com.sun.*\"]," "\n"
" print_assembly: true," "\n"
" verify_oopmaps: true," "\n"
" max_loop_unrolling: 5" "\n"
" }," "\n"
" {" "\n"
" // matching several patterns require an array" "\n"
" match: [\"baz.*\",\"frob*\"]," "\n"
"" "\n"
" // only enable c1 for this directive" "\n"
" // all enabled by default. Command disables all not listed" "\n"
" enable: \"c1\"," "\n"
"" "\n"
" // applies to all compilers" "\n"
" // + force inline, - dont inline" "\n"
" inline : [ \"+java.util.*\", \"-com.sun.*\"]," "\n"
" print_inlining: true," "\n"
"" "\n"
" // force matching compiles to be blocking/syncronous" "\n"
" blocking_compile: true" "\n"
" }," "\n"
"]" "\n", true);
}
void JSONTest::log(uint indent, const char* format, ...) {
if (VerboseInternalVMTests) {
if (prev != JSON_KEY) {
for (uint i = 0; i < indent; i++) {
_st->print(" ");
}
}
va_list args;
va_start(args, format);
_st->vprint(format, args);
va_end(args);
}
}
bool JSONTest::callback(JSON_TYPE t, JSON_VAL* v, uint rlevel) {
switch (t) {
case JSON_OBJECT_BEGIN:
log(rlevel, "{\n");
prev = JSON_NONE; // Only care about JSON_KEY, to indent correctly
return true;
case JSON_OBJECT_END:
log(rlevel, "},\n");
prev = JSON_NONE;
return true;
case JSON_ARRAY_BEGIN:
log(rlevel, "[\n");
prev = JSON_NONE;
return true;
case JSON_ARRAY_END:
log(rlevel, "],\n");
prev = JSON_NONE;
return true;
case JSON_KEY:
if (VerboseInternalVMTests) {
for (uint i = 0; i < rlevel; i++) {
_st->print(" ");
}
_st->print("<key>");
for (size_t i = 0; i < v->str.length; i++) {
u_char c = v->str.start[i];
assert(c != 0, "string overrun");
if (c == 0) {
return false;
}
_st->print("%c", c);
}
_st->print(" : ");
}
prev = JSON_KEY;
return true;
case JSON_STRING:
if (VerboseInternalVMTests) {
if (prev != JSON_KEY) {
for (uint i = 0; i < rlevel; i++) {
_st->print(" ");
}
}
_st->print("<str>");
for (size_t i = 0; i < v->str.length; i++) {
u_char c = v->str.start[i];
assert(c != 0, "string overrun");
if (c == 0) {
return false;
}
_st->print("%c", c);
}
_st->print(",\n");
}
prev = JSON_NONE;
return true;
case JSON_NUMBER_INT:
log(rlevel, "<int>%" PRId64 ",\n", v->int_value);
prev = JSON_NONE;
return true;
case JSON_NUMBER_FLOAT:
log(rlevel, "<double>%lf,\n", v->double_value);
prev = JSON_NONE;
return true;
case JSON_TRUE:
log(rlevel, "<true>,\n");
prev = JSON_NONE;
return true;
case JSON_FALSE:
log(rlevel, "<false>,\n");
prev = JSON_NONE;
return true;
case JSON_NULL:
log(rlevel, "<null>,\n");
prev = JSON_NONE;
return true;
default:
error(INTERNAL_ERROR, "unknown JSON type");
return false;
}
}
#endif

View file

@ -74,7 +74,7 @@ public class LogProcessor implements Consumer<OutputAnalyzer> {
if (loggedMethods.isEmpty()) { if (loggedMethods.isEmpty()) {
return; return;
} }
matchTasks(getScanner()); matchTasks();
} }
/* /*
@ -95,7 +95,8 @@ public class LogProcessor implements Consumer<OutputAnalyzer> {
* Parses for &lt;task method='java.lang.String indexOf (I)I' &gt; * Parses for &lt;task method='java.lang.String indexOf (I)I' &gt;
* and finds if there is a compilation log for this task * and finds if there is a compilation log for this task
*/ */
private void matchTasks(Scanner scanner) { private void matchTasks() {
try (Scanner scanner = getScanner()) {
String task = scanner.findWithinHorizon(TASK_ELEMENT, 0); String task = scanner.findWithinHorizon(TASK_ELEMENT, 0);
while (task != null) { while (task != null) {
String element = scanner.findWithinHorizon(ANY_ELEMENT, 0); String element = scanner.findWithinHorizon(ANY_ELEMENT, 0);
@ -110,6 +111,7 @@ public class LogProcessor implements Consumer<OutputAnalyzer> {
task = scanner.findWithinHorizon(TASK_ELEMENT, 0); task = scanner.findWithinHorizon(TASK_ELEMENT, 0);
} }
} }
}
// Check that input method should be logged // Check that input method should be logged
private boolean matchMethod(String input) { private boolean matchMethod(String input) {

View file

@ -23,10 +23,11 @@
/** /**
* @test * @test
* @bug 8059556 8158639 * @bug 8059556 8158639 8164508
* *
* @run main/othervm -Xbatch compiler.jsr292.NullConstantReceiver * @run main/othervm -Xbatch compiler.jsr292.NullConstantReceiver
* @run main/othervm -Xbatch -XX:CompileCommand=exclude,*::run compiler.jsr292.NullConstantReceiver * @run main/othervm -Xbatch -XX:CompileCommand=exclude,*::run compiler.jsr292.NullConstantReceiver
* @run main/othervm -Xbatch -XX:CompileCommand=compileonly,*::run compiler.jsr292.NullConstantReceiver
*/ */
package compiler.jsr292; package compiler.jsr292;

View file

@ -57,18 +57,7 @@ public class CTVMUtilities {
if (!(method instanceof Method || method instanceof Constructor)) { if (!(method instanceof Method || method instanceof Constructor)) {
throw new Error("wrong executable type " + method.getClass()); throw new Error("wrong executable type " + method.getClass());
} }
Field slotField; return CompilerToVMHelper.asResolvedJavaMethod(method);
int slot;
try {
slotField = method.getClass().getDeclaredField("slot");
boolean old = slotField.isAccessible();
slotField.setAccessible(true);
slot = slotField.getInt(method);
slotField.setAccessible(old);
} catch (ReflectiveOperationException e) {
throw new Error("TEST BUG: Can't get slot field", e);
}
return CompilerToVMHelper.getResolvedJavaMethodAtSlot(cls, slot);
} }
public static HotSpotResolvedJavaMethod getResolvedMethod( public static HotSpotResolvedJavaMethod getResolvedMethod(

View file

@ -28,6 +28,7 @@ import jdk.vm.ci.code.InvalidInstalledCodeException;
import jdk.vm.ci.code.TargetDescription; import jdk.vm.ci.code.TargetDescription;
import jdk.vm.ci.meta.ConstantPool; import jdk.vm.ci.meta.ConstantPool;
import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaMethod;
import java.lang.reflect.Executable;
/** /**
* A simple "proxy" class to get test access to CompilerToVM package-private methods * A simple "proxy" class to get test access to CompilerToVM package-private methods
@ -171,9 +172,9 @@ public class CompilerToVMHelper {
return CTVM.hasFinalizableSubclass((HotSpotResolvedObjectTypeImpl) type); return CTVM.hasFinalizableSubclass((HotSpotResolvedObjectTypeImpl) type);
} }
public static HotSpotResolvedJavaMethodImpl getResolvedJavaMethodAtSlot( public static HotSpotResolvedJavaMethodImpl asResolvedJavaMethod(
Class<?> holder, int slot) { Executable executable) {
return CTVM.getResolvedJavaMethodAtSlot(holder, slot); return CTVM.asResolvedJavaMethod(executable);
} }
public static long getMaxCallTargetOffset(long address) { public static long getMaxCallTargetOffset(long address) {

View file

@ -36,7 +36,7 @@
* jdk.vm.ci/jdk.vm.ci.meta * jdk.vm.ci/jdk.vm.ci.meta
* @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper
* @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI
* compiler.jvmci.compilerToVM.GetResolvedJavaMethodAtSlotTest * compiler.jvmci.compilerToVM.AsResolvedJavaMethodTest
*/ */
package compiler.jvmci.compilerToVM; package compiler.jvmci.compilerToVM;
@ -45,10 +45,12 @@ import jdk.test.lib.Asserts;
import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.CompilerToVMHelper;
import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
import java.util.HashMap; import java.lang.reflect.Executable;
import java.util.Map; import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
public class GetResolvedJavaMethodAtSlotTest { public class AsResolvedJavaMethodTest {
private static class A { private static class A {
{ {
@ -81,41 +83,31 @@ public class GetResolvedJavaMethodAtSlotTest {
} }
public static void main(String[] args) { public static void main(String[] args) {
Map<Class<?>, Integer> testCases = getTestCases(); List<Class<?>> testCases = getTestCases();
testCases.forEach(GetResolvedJavaMethodAtSlotTest::test); testCases.forEach(AsResolvedJavaMethodTest::test);
} }
private static Map<Class<?>, Integer> getTestCases() { private static List<Class<?>> getTestCases() {
Map<Class<?>, Integer> testCases = new HashMap<>(); List<Class<?>> testCases = new ArrayList<>();
testCases.put(A.class, 5); // ctor, init, f1, f2, f3 testCases.add(A.class);
testCases.put(S.class, 5); // ctor, cinit, f1, f2, f3 testCases.add(S.class);
testCases.put(I.class, 3); // f1, f2, f3 testCases.add(I.class);
testCases.put(B.class, 2); // ctor, f4 testCases.add(B.class);
return testCases; return testCases;
} }
private static void test(Class<?> aClass, int methodNumber) { private static void test(Class<?> aClass) {
testSlotBigger(aClass); testCorrectMethods(aClass);
testCorrectMethods(aClass, methodNumber);
} }
private static void testSlotBigger(Class<?> holder) { private static void testCorrectMethods(Class<?> holder) {
HotSpotResolvedJavaMethod method List<Executable> executables = new ArrayList<>();
= CompilerToVMHelper.getResolvedJavaMethodAtSlot(holder, 50); executables.addAll(Arrays.asList(holder.getDeclaredMethods()));
Asserts.assertNull(method, "Got method for non existing slot 50 in " executables.addAll(Arrays.asList(holder.getDeclaredConstructors()));
+ holder); for (Executable executable : executables) {
}
private static void testCorrectMethods(Class<?> holder, int methodsNumber) {
for (int i = 0; i < methodsNumber; i++) {
String caseName = String.format("slot %d in %s",
i, holder.getCanonicalName());
HotSpotResolvedJavaMethod method = CompilerToVMHelper HotSpotResolvedJavaMethod method = CompilerToVMHelper
.getResolvedJavaMethodAtSlot(holder, i); .asResolvedJavaMethod(executable);
Asserts.assertNotNull(method, caseName + " did not got method"); Asserts.assertNotNull(method, "could not convert " + method);
Asserts.assertEQ(holder,
CompilerToVMHelper.getMirror(method.getDeclaringClass()),
caseName + " : unexpected declaring class");
} }
} }
} }

View file

@ -74,45 +74,37 @@ public class FindUniqueConcreteMethodTest {
private static Set<TestCase> createTestCases() { private static Set<TestCase> createTestCases() {
Set<TestCase> result = new HashSet<>(); Set<TestCase> result = new HashSet<>();
// a public method // a public method
result.add(new TestCase(true, SingleSubclass.class, result.add(new TestCase(true, SingleSubclass.class, "usualMethod"));
SingleSubclass.class, "usualMethod"));
// overriden method // overriden method
result.add(new TestCase(true, SingleSubclass.class, result.add(new TestCase(true, SingleSubclass.class, "overridenMethod"));
SingleSubclass.class, "overridenMethod"));
// private method // private method
result.add(new TestCase(true, SingleSubclass.class, result.add(new TestCase(true, SingleSubclass.class, "privateMethod"));
SingleSubclass.class, "privateMethod"));
// protected method // protected method
result.add(new TestCase(true, SingleSubclass.class, result.add(new TestCase(true, SingleSubclass.class, "protectedMethod"));
SingleSubclass.class, "protectedMethod"));
// default(package-private) method // default(package-private) method
result.add(new TestCase(true, SingleSubclass.class, result.add(new TestCase(true, SingleSubclass.class, "defaultAccessMethod"));
SingleSubclass.class, "defaultAccessMethod"));
// default interface method redefined in implementer // default interface method redefined in implementer
result.add(new TestCase(true, MultipleImplementer1.class, result.add(new TestCase(true, MultipleImplementer1.class, "defaultMethod"));
MultipleImplementer1.class, "defaultMethod"));
// interface method // interface method
result.add(new TestCase(true, MultipleImplementer1.class, result.add(new TestCase(true, MultipleImplementer1.class, "testMethod"));
MultipleImplementer1.class, "testMethod"));
// default interface method not redefined in implementer // default interface method not redefined in implementer
result.add(new TestCase(true, SingleImplementer.class, // result.add(new TestCase(true, SingleImplementer.class,
SingleImplementerInterface.class, "defaultMethod")); // SingleImplementerInterface.class, "defaultMethod"));
// static method // static method
result.add(new TestCase(false, SingleSubclass.class, result.add(new TestCase(false, SingleSubclass.class, "staticMethod"));
SingleSubclass.class, "staticMethod"));
// interface method // interface method
result.add(new TestCase(false, MultipleSuperImplementers.class, result.add(new TestCase(false, MultipleSuperImplementers.class,
DuplicateSimpleSingleImplementerInterface.class, "interfaceMethod", false)); DuplicateSimpleSingleImplementerInterface.class, "interfaceMethod"));
result.add(new TestCase(false, MultipleSuperImplementers.class, result.add(new TestCase(false, MultipleSuperImplementers.class,
SimpleSingleImplementerInterface.class, "interfaceMethod", false)); SimpleSingleImplementerInterface.class, "interfaceMethod"));
return result; return result;
} }
private void runTest(TestCase tcase) throws NoSuchMethodException { private void runTest(TestCase tcase) throws NoSuchMethodException {
System.out.println(tcase); System.out.println(tcase);
Method method = tcase.holder.getDeclaredMethod(tcase.methodName); Method method = tcase.holder.getDeclaredMethod(tcase.methodName);
HotSpotResolvedJavaMethod testMethod = CTVMUtilities HotSpotResolvedJavaMethod testMethod = CTVMUtilities.getResolvedMethod(method);
.getResolvedMethod(tcase.methodFromReceiver ? tcase.receiver : tcase.holder, method);
HotSpotResolvedObjectType resolvedType = CompilerToVMHelper HotSpotResolvedObjectType resolvedType = CompilerToVMHelper
.lookupType(Utils.toJVMTypeSignature(tcase.receiver), getClass(), .lookupType(Utils.toJVMTypeSignature(tcase.receiver), getClass(),
/* resolve = */ true); /* resolve = */ true);
@ -127,25 +119,23 @@ public class FindUniqueConcreteMethodTest {
public final Class<?> holder; public final Class<?> holder;
public final String methodName; public final String methodName;
public final boolean isPositive; public final boolean isPositive;
public final boolean methodFromReceiver;
public TestCase(boolean isPositive, Class<?> clazz, Class<?> holder, public TestCase(boolean isPositive, Class<?> clazz, Class<?> holder,
String methodName, boolean methodFromReceiver) { String methodName) {
this.receiver = clazz; this.receiver = clazz;
this.methodName = methodName; this.methodName = methodName;
this.isPositive = isPositive; this.isPositive = isPositive;
this.holder = holder; this.holder = holder;
this.methodFromReceiver = methodFromReceiver;
} }
public TestCase(boolean isPositive, Class<?> clazz, Class<?> holder, String methodName) { public TestCase(boolean isPositive, Class<?> clazz, String methodName) {
this(isPositive, clazz, holder, methodName, true); this(isPositive, clazz, clazz, methodName);
} }
@Override @Override
public String toString() { public String toString() {
return String.format("CASE: receiver=%s, holder=%s, method=%s, isPositive=%s, methodFromReceiver=%s", return String.format("CASE: receiver=%s, holder=%s, method=%s, isPositive=%s",
receiver.getName(), holder.getName(), methodName, isPositive, methodFromReceiver); receiver.getName(), holder.getName(), methodName, isPositive);
} }
} }
} }

View file

@ -51,6 +51,7 @@ import jdk.vm.ci.hotspot.PublicMetaspaceWrapperObject;
import sun.hotspot.WhiteBox; import sun.hotspot.WhiteBox;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Method;
public class GetResolvedJavaMethodTest { public class GetResolvedJavaMethodTest {
private static enum TestCase { private static enum TestCase {
@ -64,9 +65,7 @@ public class GetResolvedJavaMethodTest {
JAVA_METHOD_BASE { JAVA_METHOD_BASE {
@Override @Override
HotSpotResolvedJavaMethod getResolvedJavaMethod() { HotSpotResolvedJavaMethod getResolvedJavaMethod() {
HotSpotResolvedJavaMethod methodInstance HotSpotResolvedJavaMethod methodInstance = TEST_METHOD;
= CompilerToVMHelper.getResolvedJavaMethodAtSlot(
TEST_CLASS, 0);
try { try {
METASPACE_METHOD_FIELD.set(methodInstance, METASPACE_METHOD_FIELD.set(methodInstance,
getPtrToMethod()); getPtrToMethod());
@ -81,9 +80,7 @@ public class GetResolvedJavaMethodTest {
@Override @Override
HotSpotResolvedJavaMethod getResolvedJavaMethod() { HotSpotResolvedJavaMethod getResolvedJavaMethod() {
long ptr = getPtrToMethod(); long ptr = getPtrToMethod();
HotSpotResolvedJavaMethod methodInstance HotSpotResolvedJavaMethod methodInstance = TEST_METHOD;
= CompilerToVMHelper.getResolvedJavaMethodAtSlot(
TEST_CLASS, 0);
try { try {
METASPACE_METHOD_FIELD.set(methodInstance, ptr / 2L); METASPACE_METHOD_FIELD.set(methodInstance, ptr / 2L);
} catch (ReflectiveOperationException e) { } catch (ReflectiveOperationException e) {
@ -97,9 +94,7 @@ public class GetResolvedJavaMethodTest {
@Override @Override
HotSpotResolvedJavaMethod getResolvedJavaMethod() { HotSpotResolvedJavaMethod getResolvedJavaMethod() {
long ptr = getPtrToMethod(); long ptr = getPtrToMethod();
HotSpotResolvedJavaMethod methodInstance HotSpotResolvedJavaMethod methodInstance = TEST_METHOD;
= CompilerToVMHelper.getResolvedJavaMethodAtSlot(
TEST_CLASS, 0);
try { try {
METASPACE_METHOD_FIELD.set(methodInstance, 0L); METASPACE_METHOD_FIELD.set(methodInstance, 0L);
} catch (ReflectiveOperationException e) { } catch (ReflectiveOperationException e) {
@ -117,16 +112,21 @@ public class GetResolvedJavaMethodTest {
private static final WhiteBox WB = WhiteBox.getWhiteBox(); private static final WhiteBox WB = WhiteBox.getWhiteBox();
private static final Field METASPACE_METHOD_FIELD; private static final Field METASPACE_METHOD_FIELD;
private static final Class<?> TEST_CLASS = GetResolvedJavaMethodTest.class; private static final Class<?> TEST_CLASS = GetResolvedJavaMethodTest.class;
private static final HotSpotResolvedJavaMethod TEST_METHOD;
private static final long PTR; private static final long PTR;
static { static {
HotSpotResolvedJavaMethod method try {
= CompilerToVMHelper.getResolvedJavaMethodAtSlot(TEST_CLASS, 0); Method method = TEST_CLASS.getDeclaredMethod("test", TestCase.class);
TEST_METHOD = CompilerToVMHelper.asResolvedJavaMethod(method);
} catch (NoSuchMethodException e) {
throw new Error("TESTBUG : " + e, e);
}
try { try {
// jdk.vm.ci.hotspot.HotSpotResolvedJavaMethodImpl.metaspaceMethod // jdk.vm.ci.hotspot.HotSpotResolvedJavaMethodImpl.metaspaceMethod
METASPACE_METHOD_FIELD = method.getClass() METASPACE_METHOD_FIELD = TEST_METHOD.getClass()
.getDeclaredField("metaspaceMethod"); .getDeclaredField("metaspaceMethod");
METASPACE_METHOD_FIELD.setAccessible(true); METASPACE_METHOD_FIELD.setAccessible(true);
PTR = (long) METASPACE_METHOD_FIELD.get(method); PTR = (long) METASPACE_METHOD_FIELD.get(TEST_METHOD);
} catch (ReflectiveOperationException e) { } catch (ReflectiveOperationException e) {
throw new Error("TESTBUG : " + e, e); throw new Error("TESTBUG : " + e, e);
} }

View file

@ -23,6 +23,10 @@
package jdk.vm.ci.hotspot.test; package jdk.vm.ci.hotspot.test;
import java.lang.reflect.Field;
import org.testng.annotations.DataProvider;
import jdk.internal.misc.Unsafe; import jdk.internal.misc.Unsafe;
import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider;
import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider;
@ -32,27 +36,14 @@ import jdk.vm.ci.meta.Constant;
import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaConstant;
import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.JavaKind;
import jdk.vm.ci.runtime.JVMCI; import jdk.vm.ci.runtime.JVMCI;
import org.testng.annotations.DataProvider;
import java.lang.reflect.Field;
public class MemoryAccessProviderData { public class MemoryAccessProviderData {
private static final Unsafe UNSAFE = getUnsafe(); private static final Unsafe UNSAFE = Unsafe.getUnsafe();
private static final HotSpotConstantReflectionProvider CONSTANT_REFLECTION = (HotSpotConstantReflectionProvider) JVMCI.getRuntime().getHostJVMCIBackend().getConstantReflection(); private static final HotSpotConstantReflectionProvider CONSTANT_REFLECTION = (HotSpotConstantReflectionProvider) JVMCI.getRuntime().getHostJVMCIBackend().getConstantReflection();
private static final TestClass TEST_OBJECT = new TestClass(); private static final TestClass TEST_OBJECT = new TestClass();
private static final JavaConstant TEST_CONSTANT = CONSTANT_REFLECTION.forObject(TEST_OBJECT); private static final JavaConstant TEST_CONSTANT = CONSTANT_REFLECTION.forObject(TEST_OBJECT);
private static final JavaConstant TEST_CLASS_CONSTANT = CONSTANT_REFLECTION.forObject(TestClass.class); private static final JavaConstant TEST_CLASS_CONSTANT = CONSTANT_REFLECTION.forObject(TestClass.class);
private static Unsafe getUnsafe() {
try {
Field f = Unsafe.class.getDeclaredField("theUnsafe");
f.setAccessible(true);
return (Unsafe) f.get(null);
} catch (NoSuchFieldException | IllegalAccessException e) {
throw new RuntimeException("Unable to get Unsafe instance.", e);
}
}
@DataProvider(name = "positiveObject") @DataProvider(name = "positiveObject")
public static Object[][] getPositiveObjectJavaKind() { public static Object[][] getPositiveObjectJavaKind() {
HotSpotJVMCIRuntimeProvider runtime = (HotSpotJVMCIRuntimeProvider) JVMCI.getRuntime(); HotSpotJVMCIRuntimeProvider runtime = (HotSpotJVMCIRuntimeProvider) JVMCI.getRuntime();

View file

@ -438,7 +438,6 @@ public class TestResolvedJavaMethod extends MethodUniverse {
// @formatter:off // @formatter:off
private static final String[] untestedApiMethods = { private static final String[] untestedApiMethods = {
"invoke",
"newInstance", "newInstance",
"getDeclaringClass", "getDeclaringClass",
"getEncoding", "getEncoding",

View file

@ -35,28 +35,6 @@
package jdk.vm.ci.runtime.test; package jdk.vm.ci.runtime.test;
import jdk.internal.reflect.ConstantPool;
import jdk.vm.ci.common.JVMCIError;
import jdk.vm.ci.meta.Assumptions.AssumptionResult;
import jdk.vm.ci.meta.JavaConstant;
import jdk.vm.ci.meta.JavaKind;
import jdk.vm.ci.meta.ModifiersProvider;
import jdk.vm.ci.meta.ResolvedJavaField;
import jdk.vm.ci.meta.ResolvedJavaMethod;
import jdk.vm.ci.meta.ResolvedJavaType;
import org.junit.Test;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import static java.lang.reflect.Modifier.isAbstract; import static java.lang.reflect.Modifier.isAbstract;
import static java.lang.reflect.Modifier.isFinal; import static java.lang.reflect.Modifier.isFinal;
import static java.lang.reflect.Modifier.isPrivate; import static java.lang.reflect.Modifier.isPrivate;
@ -70,6 +48,28 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull; import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.junit.Test;
import jdk.internal.reflect.ConstantPool;
import jdk.vm.ci.common.JVMCIError;
import jdk.vm.ci.meta.Assumptions.AssumptionResult;
import jdk.vm.ci.meta.JavaConstant;
import jdk.vm.ci.meta.JavaKind;
import jdk.vm.ci.meta.ResolvedJavaField;
import jdk.vm.ci.meta.ResolvedJavaMethod;
import jdk.vm.ci.meta.ResolvedJavaType;
/** /**
* Tests for {@link ResolvedJavaType}. * Tests for {@link ResolvedJavaType}.
*/ */
@ -146,8 +146,9 @@ public class TestResolvedJavaType extends TypeUniverse {
public void getModifiersTest() { public void getModifiersTest() {
for (Class<?> c : classes) { for (Class<?> c : classes) {
ResolvedJavaType type = metaAccess.lookupJavaType(c); ResolvedJavaType type = metaAccess.lookupJavaType(c);
int expected = c.getModifiers() & ModifiersProvider.jvmClassModifiers(); int mask = Modifier.classModifiers() & ~Modifier.STATIC;
int actual = type.getModifiers() & ModifiersProvider.jvmClassModifiers(); int expected = c.getModifiers() & mask;
int actual = type.getModifiers() & mask;
Class<?> elementalType = c; Class<?> elementalType = c;
while (elementalType.isArray()) { while (elementalType.isArray()) {
elementalType = elementalType.getComponentType(); elementalType = elementalType.getComponentType();

View file

@ -25,6 +25,7 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM; import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.process.ExitCode; import jdk.test.lib.process.ExitCode;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
@ -66,7 +67,7 @@ public abstract class RTMLockingAwareTest
boolean isExperimental, String defaultValue, boolean isExperimental, String defaultValue,
String[] correctValues, String[] incorrectValues, String[] correctValues, String[] incorrectValues,
String warningMessage) { String warningMessage) {
super(new AndPredicate(new SupportedCPU(), new SupportedVM()), super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()),
optionName, isBoolean, isExperimental, defaultValue); optionName, isBoolean, isExperimental, defaultValue);
this.correctValues = correctValues; this.correctValues = correctValues;
this.incorrectValues = incorrectValues; this.incorrectValues = incorrectValues;

View file

@ -42,6 +42,7 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM; import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate; import jdk.test.lib.cli.predicate.AndPredicate;
@ -49,7 +50,7 @@ import jdk.test.lib.cli.predicate.AndPredicate;
public class TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig public class TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig
extends TestPrintPreciseRTMLockingStatisticsBase { extends TestPrintPreciseRTMLockingStatisticsBase {
private TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig() { private TestPrintPreciseRTMLockingStatisticsOptionOnSupportedConfig() {
super(new AndPredicate(new SupportedVM(), new SupportedCPU())); super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
} }
@Override @Override

View file

@ -42,6 +42,7 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM; import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.cli.predicate.AndPredicate; import jdk.test.lib.cli.predicate.AndPredicate;
import jdk.test.lib.cli.predicate.NotPredicate; import jdk.test.lib.cli.predicate.NotPredicate;
@ -49,8 +50,8 @@ import jdk.test.lib.cli.predicate.NotPredicate;
public class TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig public class TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig
extends TestPrintPreciseRTMLockingStatisticsBase { extends TestPrintPreciseRTMLockingStatisticsBase {
private TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig() { private TestPrintPreciseRTMLockingStatisticsOptionOnUnsupportedConfig() {
super(new NotPredicate(new AndPredicate(new SupportedCPU(), super(new NotPredicate(
new SupportedVM()))); new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())));
} }
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {

View file

@ -42,6 +42,7 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM; import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.cli.predicate.AndPredicate; import jdk.test.lib.cli.predicate.AndPredicate;
import jdk.test.lib.cli.predicate.NotPredicate; import jdk.test.lib.cli.predicate.NotPredicate;
@ -51,8 +52,8 @@ public class TestRTMAbortRatioOptionOnUnsupportedConfig
private static final String DEFAULT_VALUE = "50"; private static final String DEFAULT_VALUE = "50";
private TestRTMAbortRatioOptionOnUnsupportedConfig() { private TestRTMAbortRatioOptionOnUnsupportedConfig() {
super(new NotPredicate(new AndPredicate(new SupportedVM(), super(new NotPredicate(
new SupportedCPU())), new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())),
"RTMAbortRatio", false, true, "RTMAbortRatio", false, true,
TestRTMAbortRatioOptionOnUnsupportedConfig.DEFAULT_VALUE, TestRTMAbortRatioOptionOnUnsupportedConfig.DEFAULT_VALUE,
"0", "10", "100", "200"); "0", "10", "100", "200");

View file

@ -42,6 +42,7 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM; import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.cli.predicate.AndPredicate; import jdk.test.lib.cli.predicate.AndPredicate;
import jdk.test.lib.cli.predicate.NotPredicate; import jdk.test.lib.cli.predicate.NotPredicate;
@ -51,8 +52,8 @@ public class TestRTMTotalCountIncrRateOptionOnUnsupportedConfig
private static final String DEFAULT_VALUE = "64"; private static final String DEFAULT_VALUE = "64";
private TestRTMTotalCountIncrRateOptionOnUnsupportedConfig() { private TestRTMTotalCountIncrRateOptionOnUnsupportedConfig() {
super(new NotPredicate(new AndPredicate(new SupportedCPU(), super(new NotPredicate(
new SupportedVM())), new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())),
"RTMTotalCountIncrRate", false, true, "RTMTotalCountIncrRate", false, true,
TestRTMTotalCountIncrRateOptionOnUnsupportedConfig TestRTMTotalCountIncrRateOptionOnUnsupportedConfig
.DEFAULT_VALUE, .DEFAULT_VALUE,

View file

@ -42,6 +42,7 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM; import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.process.ExitCode; import jdk.test.lib.process.ExitCode;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
@ -52,7 +53,7 @@ public class TestUseRTMDeoptOptionOnSupportedConfig
private static final String DEFAULT_VALUE = "false"; private static final String DEFAULT_VALUE = "false";
private TestUseRTMDeoptOptionOnSupportedConfig() { private TestUseRTMDeoptOptionOnSupportedConfig() {
super(new AndPredicate(new SupportedVM(), new SupportedCPU())); super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
} }
@Override @Override

View file

@ -42,6 +42,7 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM; import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
import jdk.test.lib.cli.predicate.AndPredicate; import jdk.test.lib.cli.predicate.AndPredicate;
@ -52,8 +53,8 @@ public class TestUseRTMDeoptOptionOnUnsupportedConfig
private static final String DEFAULT_VALUE = "false"; private static final String DEFAULT_VALUE = "false";
private TestUseRTMDeoptOptionOnUnsupportedConfig() { private TestUseRTMDeoptOptionOnUnsupportedConfig() {
super(new NotPredicate(new AndPredicate(new SupportedCPU(), super(new NotPredicate(
new SupportedVM())), new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())),
"UseRTMDeopt", true, false, "UseRTMDeopt", true, false,
TestUseRTMDeoptOptionOnUnsupportedConfig.DEFAULT_VALUE, TestUseRTMDeoptOptionOnUnsupportedConfig.DEFAULT_VALUE,
"true"); "true");

View file

@ -42,6 +42,7 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM; import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.process.ExitCode; import jdk.test.lib.process.ExitCode;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
@ -52,7 +53,7 @@ public class TestUseRTMForStackLocksOptionOnSupportedConfig
private static final String DEFAULT_VALUE = "false"; private static final String DEFAULT_VALUE = "false";
private TestUseRTMForStackLocksOptionOnSupportedConfig() { private TestUseRTMForStackLocksOptionOnSupportedConfig() {
super(new AndPredicate(new SupportedVM(), new SupportedCPU())); super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
} }
@Override @Override

View file

@ -42,6 +42,7 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM; import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.process.ExitCode; import jdk.test.lib.process.ExitCode;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
@ -53,8 +54,8 @@ public class TestUseRTMForStackLocksOptionOnUnsupportedConfig
private static final String DEFAULT_VALUE = "false"; private static final String DEFAULT_VALUE = "false";
private TestUseRTMForStackLocksOptionOnUnsupportedConfig() { private TestUseRTMForStackLocksOptionOnUnsupportedConfig() {
super(new NotPredicate(new AndPredicate(new SupportedCPU(), super(new NotPredicate(
new SupportedVM())), new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM())),
"UseRTMForStackLocks", true, true, "UseRTMForStackLocks", true, true,
TestUseRTMForStackLocksOptionOnUnsupportedConfig.DEFAULT_VALUE, TestUseRTMForStackLocksOptionOnUnsupportedConfig.DEFAULT_VALUE,
"true"); "true");

View file

@ -42,6 +42,7 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM; import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.process.ExitCode; import jdk.test.lib.process.ExitCode;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
@ -52,7 +53,7 @@ public class TestUseRTMLockingOptionOnSupportedConfig
private static final String DEFAULT_VALUE = "false"; private static final String DEFAULT_VALUE = "false";
private TestUseRTMLockingOptionOnSupportedConfig() { private TestUseRTMLockingOptionOnSupportedConfig() {
super(new AndPredicate(new SupportedVM(), new SupportedCPU())); super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
} }
@Override @Override

View file

@ -42,6 +42,7 @@
package compiler.rtm.cli; package compiler.rtm.cli;
import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM; import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.process.ExitCode; import jdk.test.lib.process.ExitCode;
import jdk.test.lib.cli.CommandLineOptionTest; import jdk.test.lib.cli.CommandLineOptionTest;
@ -50,7 +51,7 @@ import jdk.test.lib.cli.predicate.AndPredicate;
public class TestUseRTMLockingOptionWithBiasedLocking public class TestUseRTMLockingOptionWithBiasedLocking
extends CommandLineOptionTest { extends CommandLineOptionTest {
private TestUseRTMLockingOptionWithBiasedLocking() { private TestUseRTMLockingOptionWithBiasedLocking() {
super(new AndPredicate(new SupportedCPU(), new SupportedVM())); super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
} }
@Override @Override

View file

@ -45,6 +45,7 @@ import compiler.testlibrary.rtm.CompilableTest;
import compiler.testlibrary.rtm.RTMLockingStatistics; import compiler.testlibrary.rtm.RTMLockingStatistics;
import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.RTMTestBase;
import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM; import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.internal.misc.Unsafe; import jdk.internal.misc.Unsafe;
import jdk.test.lib.Asserts; import jdk.test.lib.Asserts;
@ -60,7 +61,7 @@ import java.util.List;
*/ */
public class TestRTMAbortRatio extends CommandLineOptionTest { public class TestRTMAbortRatio extends CommandLineOptionTest {
private TestRTMAbortRatio() { private TestRTMAbortRatio() {
super(new AndPredicate(new SupportedCPU(), new SupportedVM())); super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
} }
@Override @Override

View file

@ -45,6 +45,7 @@ import compiler.testlibrary.rtm.AbortType;
import compiler.testlibrary.rtm.RTMLockingStatistics; import compiler.testlibrary.rtm.RTMLockingStatistics;
import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.RTMTestBase;
import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM; import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.test.lib.Asserts; import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
@ -59,7 +60,7 @@ import java.util.List;
*/ */
public class TestRTMAbortThreshold extends CommandLineOptionTest { public class TestRTMAbortThreshold extends CommandLineOptionTest {
private TestRTMAbortThreshold() { private TestRTMAbortThreshold() {
super(new AndPredicate(new SupportedCPU(), new SupportedVM())); super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
} }
@Override @Override

View file

@ -47,6 +47,7 @@ import compiler.testlibrary.rtm.CompilableTest;
import compiler.testlibrary.rtm.RTMLockingStatistics; import compiler.testlibrary.rtm.RTMLockingStatistics;
import compiler.testlibrary.rtm.RTMTestBase; import compiler.testlibrary.rtm.RTMTestBase;
import compiler.testlibrary.rtm.predicate.SupportedCPU; import compiler.testlibrary.rtm.predicate.SupportedCPU;
import compiler.testlibrary.rtm.predicate.SupportedOS;
import compiler.testlibrary.rtm.predicate.SupportedVM; import compiler.testlibrary.rtm.predicate.SupportedVM;
import jdk.internal.misc.Unsafe; import jdk.internal.misc.Unsafe;
import jdk.test.lib.Asserts; import jdk.test.lib.Asserts;
@ -86,7 +87,7 @@ public class TestRTMAfterNonRTMDeopt extends CommandLineOptionTest {
private static final String RANGE_CHECK = "range_check"; private static final String RANGE_CHECK = "range_check";
private TestRTMAfterNonRTMDeopt() { private TestRTMAfterNonRTMDeopt() {
super(new AndPredicate(new SupportedCPU(), new SupportedVM())); super(new AndPredicate(new SupportedCPU(), new SupportedOS(), new SupportedVM()));
} }
@Override @Override

Some files were not shown because too many files have changed in this diff Show more