View | Details | Raw Unified | Return to bug 158304
Collapse All | Expand All

(-)openjdk/hotspot/src/cpu/x86/vm/assembler_x86.cpp (-8 / +23 lines)
Lines 7643-7648 Link Here
7643
  }
7643
  }
7644
}
7644
}
7645
7645
7646
void MacroAssembler::cmov32(Condition cc, Register dst, Address src) {
7647
  if (VM_Version::supports_cmov()) {
7648
    cmovl(cc, dst, src);
7649
  } else {
7650
    Label L;
7651
    jccb(negate_condition(cc), L);
7652
    movl(dst, src);
7653
    bind(L);
7654
  }
7655
}
7656
7657
void MacroAssembler::cmov32(Condition cc, Register dst, Register src) {
7658
  if (VM_Version::supports_cmov()) {
7659
    cmovl(cc, dst, src);
7660
  } else {
7661
    Label L;
7662
    jccb(negate_condition(cc), L);
7663
    movl(dst, src);
7664
    bind(L);
7665
  }
7666
}
7667
7646
void MacroAssembler::verify_oop(Register reg, const char* s) {
7668
void MacroAssembler::verify_oop(Register reg, const char* s) {
7647
  if (!VerifyOops) return;
7669
  if (!VerifyOops) return;
7648
7670
Lines 8559-8572 Link Here
8559
  movl(result, cnt1);
8581
  movl(result, cnt1);
8560
  subl(cnt1, cnt2);
8582
  subl(cnt1, cnt2);
8561
  push(cnt1);
8583
  push(cnt1);
8562
  if (VM_Version::supports_cmov()) {
8584
  cmov32(Assembler::lessEqual, cnt2, result);
8563
    cmovl(Assembler::lessEqual, cnt2, result);
8564
  } else {
8565
    Label GT_LABEL;
8566
    jccb(Assembler::greater, GT_LABEL);
8567
    movl(cnt2, result);
8568
    bind(GT_LABEL);
8569
  }
8570
8585
8571
  // Is the minimum length zero?
8586
  // Is the minimum length zero?
8572
  testl(cnt2, cnt2);
8587
  testl(cnt2, cnt2);
(-)openjdk/hotspot/src/cpu/x86/vm/assembler_x86.hpp (-3 / +6 lines)
Lines 2174-2183 Link Here
2174
2174
2175
  // Data
2175
  // Data
2176
2176
2177
  void cmov(Condition cc, Register dst, Register src) { LP64_ONLY(cmovq(cc, dst, src)) NOT_LP64(cmovl(cc, dst, src)); }
2177
  void cmov32( Condition cc, Register dst, Address  src);
2178
  void cmov32( Condition cc, Register dst, Register src);
2178
2179
2179
  void cmovptr(Condition cc, Register dst, Address src) { LP64_ONLY(cmovq(cc, dst, src)) NOT_LP64(cmovl(cc, dst, src)); }
2180
  void cmov(   Condition cc, Register dst, Register src) { cmovptr(cc, dst, src); }
2180
  void cmovptr(Condition cc, Register dst, Register src) { LP64_ONLY(cmovq(cc, dst, src)) NOT_LP64(cmovl(cc, dst, src)); }
2181
2182
  void cmovptr(Condition cc, Register dst, Address  src) { LP64_ONLY(cmovq(cc, dst, src)) NOT_LP64(cmov32(cc, dst, src)); }
2183
  void cmovptr(Condition cc, Register dst, Register src) { LP64_ONLY(cmovq(cc, dst, src)) NOT_LP64(cmov32(cc, dst, src)); }
2181
2184
2182
  void movoop(Register dst, jobject obj);
2185
  void movoop(Register dst, jobject obj);
2183
  void movoop(Address dst, jobject obj);
2186
  void movoop(Address dst, jobject obj);
(-)openjdk/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp (-18 / +7 lines)
Lines 559-582 Link Here
559
  __ lea    (rdi, Address(rdi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
559
  __ lea    (rdi, Address(rdi, rcx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)));
560
560
561
  // compute minimum length (in rax) and difference of lengths (on top of stack)
561
  // compute minimum length (in rax) and difference of lengths (on top of stack)
562
  if (VM_Version::supports_cmov()) {
562
  __ movl  (rbx, Address(rbx, java_lang_String::count_offset_in_bytes()));
563
    __ movl     (rbx, Address(rbx, java_lang_String::count_offset_in_bytes()));
563
  __ movl  (rax, Address(rax, java_lang_String::count_offset_in_bytes()));
564
    __ movl     (rax, Address(rax, java_lang_String::count_offset_in_bytes()));
564
  __ mov   (rcx, rbx);
565
    __ mov      (rcx, rbx);
565
  __ subptr(rbx, rax); // subtract lengths
566
    __ subptr   (rbx, rax); // subtract lengths
566
  __ push  (rbx);      // result
567
    __ push     (rbx);      // result
567
  __ cmov  (Assembler::lessEqual, rax, rcx);
568
    __ cmov     (Assembler::lessEqual, rax, rcx);
568
569
  } else {
570
    Label L;
571
    __ movl     (rbx, Address(rbx, java_lang_String::count_offset_in_bytes()));
572
    __ movl     (rcx, Address(rax, java_lang_String::count_offset_in_bytes()));
573
    __ mov      (rax, rbx);
574
    __ subptr   (rbx, rcx);
575
    __ push     (rbx);
576
    __ jcc      (Assembler::lessEqual, L);
577
    __ mov      (rax, rcx);
578
    __ bind (L);
579
  }
580
  // is minimum length 0?
569
  // is minimum length 0?
581
  Label noLoop, haveResult;
570
  Label noLoop, haveResult;
582
  __ testptr (rax, rax);
571
  __ testptr (rax, rax);
(-)openjdk/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp (-24 / +8 lines)
Lines 1931-1948 Link Here
1931
    __ movl(temp, Address(array, h, Address::times_8, 0*wordSize));
1931
    __ movl(temp, Address(array, h, Address::times_8, 0*wordSize));
1932
    __ bswapl(temp);
1932
    __ bswapl(temp);
1933
    __ cmpl(key, temp);
1933
    __ cmpl(key, temp);
1934
    if (VM_Version::supports_cmov()) {
1934
    // j = h if (key <  array[h].fast_match())
1935
      __ cmovl(Assembler::less        , j, h);   // j = h if (key <  array[h].fast_match())
1935
    __ cmov32(Assembler::less        , j, h);
1936
      __ cmovl(Assembler::greaterEqual, i, h);   // i = h if (key >= array[h].fast_match())
1936
    // i = h if (key >= array[h].fast_match())
1937
    } else {
1937
    __ cmov32(Assembler::greaterEqual, i, h);
1938
      Label set_i, end_of_if;
1939
      __ jccb(Assembler::greaterEqual, set_i);     // {
1940
      __ mov(j, h);                                //   j = h;
1941
      __ jmp(end_of_if);                           // }
1942
      __ bind(set_i);                              // else {
1943
      __ mov(i, h);                                //   i = h;
1944
      __ bind(end_of_if);                          // }
1945
    }
1946
    // while (i+1 < j)
1938
    // while (i+1 < j)
1947
    __ bind(entry);
1939
    __ bind(entry);
1948
    __ leal(h, Address(i, 1));                   // i+1
1940
    __ leal(h, Address(i, 1));                   // i+1
Lines 3463-3484 Link Here
3463
3455
3464
  // find a free slot in the monitor block (result in rdx)
3456
  // find a free slot in the monitor block (result in rdx)
3465
  { Label entry, loop, exit;
3457
  { Label entry, loop, exit;
3466
    __ movptr(rcx, monitor_block_top);            // points to current entry, starting with top-most entry
3458
    __ movptr(rcx, monitor_block_top);           // points to current entry, starting with top-most entry
3467
    __ lea(rbx, monitor_block_bot);               // points to word before bottom of monitor block
3459
3460
    __ lea(rbx, monitor_block_bot);              // points to word before bottom of monitor block
3468
    __ jmpb(entry);
3461
    __ jmpb(entry);
3469
3462
3470
    __ bind(loop);
3463
    __ bind(loop);
3471
    __ cmpptr(Address(rcx, BasicObjectLock::obj_offset_in_bytes()), (int32_t)NULL_WORD);  // check if current entry is used
3464
    __ cmpptr(Address(rcx, BasicObjectLock::obj_offset_in_bytes()), (int32_t)NULL_WORD);  // check if current entry is used
3472
3465
    __ cmovptr(Assembler::equal, rdx, rcx);      // if not used then remember entry in rdx
3473
// TODO - need new func here - kbt
3474
    if (VM_Version::supports_cmov()) {
3475
      __ cmov(Assembler::equal, rdx, rcx);       // if not used then remember entry in rdx
3476
    } else {
3477
      Label L;
3478
      __ jccb(Assembler::notEqual, L);
3479
      __ mov(rdx, rcx);                          // if not used then remember entry in rdx
3480
      __ bind(L);
3481
    }
3482
    __ cmpptr(rax, Address(rcx, BasicObjectLock::obj_offset_in_bytes()));   // check if current entry is for same object
3466
    __ cmpptr(rax, Address(rcx, BasicObjectLock::obj_offset_in_bytes()));   // check if current entry is for same object
3483
    __ jccb(Assembler::equal, exit);             // if same object then stop searching
3467
    __ jccb(Assembler::equal, exit);             // if same object then stop searching
3484
    __ addptr(rcx, entry_size);                  // otherwise advance to next entry
3468
    __ addptr(rcx, entry_size);                  // otherwise advance to next entry

Return to bug 158304