comparison src/cpu/x86/vm/assembler_x86.cpp @ 17780:606acabe7b5c

8031320: Use Intel RTM instructions for locks Summary: Use RTM for inflated locks and stack locks. Reviewed-by: iveresov, twisti, roland, dcubed
author kvn
date Thu, 20 Mar 2014 17:49:27 -0700
parents 8a8ff6b577ed
children eb6b3ac64f0e
comparison
equal deleted inserted replaced
17778:a48e16541e6b 17780:606acabe7b5c
2341 emit_int8(0x00); 2341 emit_int8(0x00);
2342 emit_int8(0xC0 | encode); 2342 emit_int8(0xC0 | encode);
2343 emit_int8(imm8); 2343 emit_int8(imm8);
2344 } 2344 }
2345 2345
2346 void Assembler::pause() {
2347 emit_int8((unsigned char)0xF3);
2348 emit_int8((unsigned char)0x90);
2349 }
2350
2346 void Assembler::pcmpestri(XMMRegister dst, Address src, int imm8) { 2351 void Assembler::pcmpestri(XMMRegister dst, Address src, int imm8) {
2347 assert(VM_Version::supports_sse4_2(), ""); 2352 assert(VM_Version::supports_sse4_2(), "");
2348 InstructionMark im(this); 2353 InstructionMark im(this);
2349 simd_prefix(dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A); 2354 simd_prefix(dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A);
2350 emit_int8(0x61); 2355 emit_int8(0x61);
2663 } else { 2668 } else {
2664 emit_int8((unsigned char)0xC1); 2669 emit_int8((unsigned char)0xC1);
2665 emit_int8((unsigned char)0xD0 | encode); 2670 emit_int8((unsigned char)0xD0 | encode);
2666 emit_int8(imm8); 2671 emit_int8(imm8);
2667 } 2672 }
2673 }
2674
2675 void Assembler::rdtsc() {
2676 emit_int8((unsigned char)0x0F);
2677 emit_int8((unsigned char)0x31);
2668 } 2678 }
2669 2679
2670 // copies data from [esi] to [edi] using rcx pointer sized words 2680 // copies data from [esi] to [edi] using rcx pointer sized words
2671 // generic 2681 // generic
2672 void Assembler::rep_mov() { 2682 void Assembler::rep_mov() {
2974 void Assembler::ucomiss(XMMRegister dst, XMMRegister src) { 2984 void Assembler::ucomiss(XMMRegister dst, XMMRegister src) {
2975 NOT_LP64(assert(VM_Version::supports_sse(), "")); 2985 NOT_LP64(assert(VM_Version::supports_sse(), ""));
2976 emit_simd_arith_nonds(0x2E, dst, src, VEX_SIMD_NONE); 2986 emit_simd_arith_nonds(0x2E, dst, src, VEX_SIMD_NONE);
2977 } 2987 }
2978 2988
2989 void Assembler::xabort(int8_t imm8) {
2990 emit_int8((unsigned char)0xC6);
2991 emit_int8((unsigned char)0xF8);
2992 emit_int8((unsigned char)(imm8 & 0xFF));
2993 }
2979 2994
2980 void Assembler::xaddl(Address dst, Register src) { 2995 void Assembler::xaddl(Address dst, Register src) {
2981 InstructionMark im(this); 2996 InstructionMark im(this);
2982 prefix(dst, src); 2997 prefix(dst, src);
2983 emit_int8(0x0F); 2998 emit_int8(0x0F);
2984 emit_int8((unsigned char)0xC1); 2999 emit_int8((unsigned char)0xC1);
2985 emit_operand(src, dst); 3000 emit_operand(src, dst);
3001 }
3002
3003 void Assembler::xbegin(Label& abort, relocInfo::relocType rtype) {
3004 InstructionMark im(this);
3005 relocate(rtype);
3006 if (abort.is_bound()) {
3007 address entry = target(abort);
3008 assert(entry != NULL, "abort entry NULL");
3009 intptr_t offset = entry - pc();
3010 emit_int8((unsigned char)0xC7);
3011 emit_int8((unsigned char)0xF8);
3012 emit_int32(offset - 6); // 2 opcode + 4 address
3013 } else {
3014 abort.add_patch_at(code(), locator());
3015 emit_int8((unsigned char)0xC7);
3016 emit_int8((unsigned char)0xF8);
3017 emit_int32(0);
3018 }
2986 } 3019 }
2987 3020
2988 void Assembler::xchgl(Register dst, Address src) { // xchg 3021 void Assembler::xchgl(Register dst, Address src) { // xchg
2989 InstructionMark im(this); 3022 InstructionMark im(this);
2990 prefix(src, dst); 3023 prefix(src, dst);
2994 3027
2995 void Assembler::xchgl(Register dst, Register src) { 3028 void Assembler::xchgl(Register dst, Register src) {
2996 int encode = prefix_and_encode(dst->encoding(), src->encoding()); 3029 int encode = prefix_and_encode(dst->encoding(), src->encoding());
2997 emit_int8((unsigned char)0x87); 3030 emit_int8((unsigned char)0x87);
2998 emit_int8((unsigned char)(0xC0 | encode)); 3031 emit_int8((unsigned char)(0xC0 | encode));
3032 }
3033
3034 void Assembler::xend() {
3035 emit_int8((unsigned char)0x0F);
3036 emit_int8((unsigned char)0x01);
3037 emit_int8((unsigned char)0xD5);
2999 } 3038 }
3000 3039
3001 void Assembler::xgetbv() { 3040 void Assembler::xgetbv() {
3002 emit_int8(0x0F); 3041 emit_int8(0x0F);
3003 emit_int8(0x01); 3042 emit_int8(0x01);