< prev index next >

src/hotspot/cpu/aarch64/templateTable_aarch64.cpp

Print this page
8248238: Adding Windows support to OpenJDK on AArch64

Summary: LP64 vs LLP64 changes to add Windows support

Contributed-by: Monica Beckwith <monica.beckwith@microsoft.com>, Ludovic Henry <luhenry@microsoft.com>
Reviewed-by:


1689     __ get_fpsr(r1);
1690     __ cbzw(r1, L_Okay);
1691     __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::d2l));
1692     __ bind(L_Okay);
1693   }
1694     break;
1695   case Bytecodes::_d2f:
1696     __ fcvtd(v0, v0);
1697     break;
1698   default:
1699     ShouldNotReachHere();
1700   }
1701 }
1702 
1703 void TemplateTable::lcmp()
1704 {
1705   transition(ltos, itos);
1706   Label done;
1707   __ pop_l(r1);
1708   __ cmp(r1, r0);
1709   __ mov(r0, (u_int64_t)-1L);
1710   __ br(Assembler::LT, done);
1711   // __ mov(r0, 1UL);
1712   // __ csel(r0, r0, zr, Assembler::NE);
1713   // and here is a faster way
1714   __ csinc(r0, zr, zr, Assembler::EQ);
1715   __ bind(done);
1716 }
1717 
1718 void TemplateTable::float_cmp(bool is_float, int unordered_result)
1719 {
1720   Label done;
1721   if (is_float) {
1722     // XXX get rid of pop here, use ... reg, mem32
1723     __ pop_f(v1);
1724     __ fcmps(v1, v0);
1725   } else {
1726     // XXX get rid of pop here, use ... reg, mem64
1727     __ pop_d(v1);
1728     __ fcmpd(v1, v0);
1729   }
1730   if (unordered_result < 0) {
1731     // we want -1 for unordered or less than, 0 for equal and 1 for
1732     // greater than.
1733     __ mov(r0, (u_int64_t)-1L);
1734     // for FP LT tests less than or unordered
1735     __ br(Assembler::LT, done);
1736     // install 0 for EQ otherwise 1
1737     __ csinc(r0, zr, zr, Assembler::EQ);
1738   } else {
1739     // we want -1 for less than, 0 for equal and 1 for unordered or
1740     // greater than.
1741     __ mov(r0, 1L);
1742     // for FP HI tests greater than or unordered
1743     __ br(Assembler::HI, done);
1744     // install 0 for EQ otherwise ~0
1745     __ csinv(r0, zr, zr, Assembler::EQ);
1746 
1747   }
1748   __ bind(done);
1749 }
1750 
1751 void TemplateTable::branch(bool is_jsr, bool is_wide)
1752 {
1753   // We might be moving to a safepoint.  The thread which calls




1689     __ get_fpsr(r1);
1690     __ cbzw(r1, L_Okay);
1691     __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::d2l));
1692     __ bind(L_Okay);
1693   }
1694     break;
1695   case Bytecodes::_d2f:
1696     __ fcvtd(v0, v0);
1697     break;
1698   default:
1699     ShouldNotReachHere();
1700   }
1701 }
1702 
1703 void TemplateTable::lcmp()
1704 {
1705   transition(ltos, itos);
1706   Label done;
1707   __ pop_l(r1);
1708   __ cmp(r1, r0);
1709   __ mov(r0, (uint64_t)-1L);
1710   __ br(Assembler::LT, done);
1711   // __ mov(r0, 1UL);
1712   // __ csel(r0, r0, zr, Assembler::NE);
1713   // and here is a faster way
1714   __ csinc(r0, zr, zr, Assembler::EQ);
1715   __ bind(done);
1716 }
1717 
1718 void TemplateTable::float_cmp(bool is_float, int unordered_result)
1719 {
1720   Label done;
1721   if (is_float) {
1722     // XXX get rid of pop here, use ... reg, mem32
1723     __ pop_f(v1);
1724     __ fcmps(v1, v0);
1725   } else {
1726     // XXX get rid of pop here, use ... reg, mem64
1727     __ pop_d(v1);
1728     __ fcmpd(v1, v0);
1729   }
1730   if (unordered_result < 0) {
1731     // we want -1 for unordered or less than, 0 for equal and 1 for
1732     // greater than.
1733     __ mov(r0, (uint64_t)-1L);
1734     // for FP LT tests less than or unordered
1735     __ br(Assembler::LT, done);
1736     // install 0 for EQ otherwise 1
1737     __ csinc(r0, zr, zr, Assembler::EQ);
1738   } else {
1739     // we want -1 for less than, 0 for equal and 1 for unordered or
1740     // greater than.
1741     __ mov(r0, 1L);
1742     // for FP HI tests greater than or unordered
1743     __ br(Assembler::HI, done);
1744     // install 0 for EQ otherwise ~0
1745     __ csinv(r0, zr, zr, Assembler::EQ);
1746 
1747   }
1748   __ bind(done);
1749 }
1750 
1751 void TemplateTable::branch(bool is_jsr, bool is_wide)
1752 {
1753   // We might be moving to a safepoint.  The thread which calls


< prev index next >