5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_c1_CodeStubs_x86.cpp.incl" 27 28 29 #define __ ce->masm()-> 30 31 float ConversionStub::float_zero = 0.0; 32 double ConversionStub::double_zero = 0.0; 33 34 void ConversionStub::emit_code(LIR_Assembler* ce) { 35 __ bind(_entry); 36 assert(bytecode() == Bytecodes::_f2i || bytecode() == Bytecodes::_d2i, "other conversions do not require stub"); 37 38 39 if (input()->is_single_xmm()) { 40 __ comiss(input()->as_xmm_float_reg(), 41 ExternalAddress((address)&float_zero)); 42 } else if (input()->is_double_xmm()) { 43 __ comisd(input()->as_xmm_double_reg(), 44 ExternalAddress((address)&double_zero)); 45 } else { 46 LP64_ONLY(ShouldNotReachHere()); | 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "c1/c1_CodeStubs.hpp" 27 #include "c1/c1_FrameMap.hpp" 28 #include "c1/c1_LIRAssembler.hpp" 29 #include "c1/c1_MacroAssembler.hpp" 30 #include "c1/c1_Runtime1.hpp" 31 #include "nativeInst_x86.hpp" 32 #include "runtime/sharedRuntime.hpp" 33 #include "vmreg_x86.inline.hpp" 34 #ifndef SERIALGC 35 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" 36 #endif 37 38 39 #define __ ce->masm()-> 40 41 float ConversionStub::float_zero = 0.0; 42 double ConversionStub::double_zero = 0.0; 43 44 void ConversionStub::emit_code(LIR_Assembler* ce) { 45 __ bind(_entry); 46 assert(bytecode() == Bytecodes::_f2i || bytecode() == Bytecodes::_d2i, "other conversions do not require stub"); 47 48 49 if (input()->is_single_xmm()) { 50 __ comiss(input()->as_xmm_float_reg(), 51 ExternalAddress((address)&float_zero)); 52 } else if (input()->is_double_xmm()) { 53 __ comisd(input()->as_xmm_double_reg(), 54 ExternalAddress((address)&double_zero)); 55 } else { 56 LP64_ONLY(ShouldNotReachHere()); |