comparison src/share/vm/c1/c1_LIR.hpp @ 11080:b800986664f4

7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32 Summary: add intrinsics using new instruction to interpreter, C1, C2, for suitable x86; add test Reviewed-by: kvn, twisti
author drchase
date Tue, 02 Jul 2013 20:42:12 -0400
parents acadb114c818
children f98f5d48f511
comparison
equal deleted inserted replaced
11079:738e04fb1232 11080:b800986664f4
1 /* 1 /*
2 * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 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 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
875 class LIR_OpAllocArray; 875 class LIR_OpAllocArray;
876 class LIR_OpCall; 876 class LIR_OpCall;
877 class LIR_OpJavaCall; 877 class LIR_OpJavaCall;
878 class LIR_OpRTCall; 878 class LIR_OpRTCall;
879 class LIR_OpArrayCopy; 879 class LIR_OpArrayCopy;
880 class LIR_OpUpdateCRC32;
880 class LIR_OpLock; 881 class LIR_OpLock;
881 class LIR_OpTypeCheck; 882 class LIR_OpTypeCheck;
882 class LIR_OpCompareAndSwap; 883 class LIR_OpCompareAndSwap;
883 class LIR_OpProfileCall; 884 class LIR_OpProfileCall;
884 #ifdef ASSERT 885 #ifdef ASSERT
980 , lir_dynamic_call 981 , lir_dynamic_call
981 , end_opJavaCall 982 , end_opJavaCall
982 , begin_opArrayCopy 983 , begin_opArrayCopy
983 , lir_arraycopy 984 , lir_arraycopy
984 , end_opArrayCopy 985 , end_opArrayCopy
986 , begin_opUpdateCRC32
987 , lir_updatecrc32
988 , end_opUpdateCRC32
985 , begin_opLock 989 , begin_opLock
986 , lir_lock 990 , lir_lock
987 , lir_unlock 991 , lir_unlock
988 , end_opLock 992 , end_opLock
989 , begin_delay_slot 993 , begin_delay_slot
1135 virtual LIR_Op0* as_Op0() { return NULL; } 1139 virtual LIR_Op0* as_Op0() { return NULL; }
1136 virtual LIR_Op1* as_Op1() { return NULL; } 1140 virtual LIR_Op1* as_Op1() { return NULL; }
1137 virtual LIR_Op2* as_Op2() { return NULL; } 1141 virtual LIR_Op2* as_Op2() { return NULL; }
1138 virtual LIR_Op3* as_Op3() { return NULL; } 1142 virtual LIR_Op3* as_Op3() { return NULL; }
1139 virtual LIR_OpArrayCopy* as_OpArrayCopy() { return NULL; } 1143 virtual LIR_OpArrayCopy* as_OpArrayCopy() { return NULL; }
1144 virtual LIR_OpUpdateCRC32* as_OpUpdateCRC32() { return NULL; }
1140 virtual LIR_OpTypeCheck* as_OpTypeCheck() { return NULL; } 1145 virtual LIR_OpTypeCheck* as_OpTypeCheck() { return NULL; }
1141 virtual LIR_OpCompareAndSwap* as_OpCompareAndSwap() { return NULL; } 1146 virtual LIR_OpCompareAndSwap* as_OpCompareAndSwap() { return NULL; }
1142 virtual LIR_OpProfileCall* as_OpProfileCall() { return NULL; } 1147 virtual LIR_OpProfileCall* as_OpProfileCall() { return NULL; }
1143 #ifdef ASSERT 1148 #ifdef ASSERT
1144 virtual LIR_OpAssert* as_OpAssert() { return NULL; } 1149 virtual LIR_OpAssert* as_OpAssert() { return NULL; }
1291 virtual void emit_code(LIR_Assembler* masm); 1296 virtual void emit_code(LIR_Assembler* masm);
1292 virtual LIR_OpArrayCopy* as_OpArrayCopy() { return this; } 1297 virtual LIR_OpArrayCopy* as_OpArrayCopy() { return this; }
1293 void print_instr(outputStream* out) const PRODUCT_RETURN; 1298 void print_instr(outputStream* out) const PRODUCT_RETURN;
1294 }; 1299 };
1295 1300
1301 // LIR_OpUpdateCRC32
1302 class LIR_OpUpdateCRC32: public LIR_Op {
1303 friend class LIR_OpVisitState;
1304
1305 private:
1306 LIR_Opr _crc;
1307 LIR_Opr _val;
1308
1309 public:
1310
1311 LIR_OpUpdateCRC32(LIR_Opr crc, LIR_Opr val, LIR_Opr res);
1312
1313 LIR_Opr crc() const { return _crc; }
1314 LIR_Opr val() const { return _val; }
1315
1316 virtual void emit_code(LIR_Assembler* masm);
1317 virtual LIR_OpUpdateCRC32* as_OpUpdateCRC32() { return this; }
1318 void print_instr(outputStream* out) const PRODUCT_RETURN;
1319 };
1296 1320
1297 // -------------------------------------------------- 1321 // --------------------------------------------------
1298 // LIR_Op0 1322 // LIR_Op0
1299 // -------------------------------------------------- 1323 // --------------------------------------------------
1300 class LIR_Op0: public LIR_Op { 1324 class LIR_Op0: public LIR_Op {
2209 void set_24bit_fpu() { append(new LIR_Op0(lir_24bit_FPU )); } 2233 void set_24bit_fpu() { append(new LIR_Op0(lir_24bit_FPU )); }
2210 void restore_fpu() { append(new LIR_Op0(lir_reset_FPU )); } 2234 void restore_fpu() { append(new LIR_Op0(lir_reset_FPU )); }
2211 void breakpoint() { append(new LIR_Op0(lir_breakpoint)); } 2235 void breakpoint() { append(new LIR_Op0(lir_breakpoint)); }
2212 2236
2213 void arraycopy(LIR_Opr src, LIR_Opr src_pos, LIR_Opr dst, LIR_Opr dst_pos, LIR_Opr length, LIR_Opr tmp, ciArrayKlass* expected_type, int flags, CodeEmitInfo* info) { append(new LIR_OpArrayCopy(src, src_pos, dst, dst_pos, length, tmp, expected_type, flags, info)); } 2237 void arraycopy(LIR_Opr src, LIR_Opr src_pos, LIR_Opr dst, LIR_Opr dst_pos, LIR_Opr length, LIR_Opr tmp, ciArrayKlass* expected_type, int flags, CodeEmitInfo* info) { append(new LIR_OpArrayCopy(src, src_pos, dst, dst_pos, length, tmp, expected_type, flags, info)); }
2238
2239 void update_crc32(LIR_Opr crc, LIR_Opr val, LIR_Opr res) { append(new LIR_OpUpdateCRC32(crc, val, res)); }
2214 2240
2215 void fpop_raw() { append(new LIR_Op0(lir_fpop_raw)); } 2241 void fpop_raw() { append(new LIR_Op0(lir_fpop_raw)); }
2216 2242
2217 void instanceof(LIR_Opr result, LIR_Opr object, ciKlass* klass, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, bool fast_check, CodeEmitInfo* info_for_patch, ciMethod* profiled_method, int profiled_bci); 2243 void instanceof(LIR_Opr result, LIR_Opr object, ciKlass* klass, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, bool fast_check, CodeEmitInfo* info_for_patch, ciMethod* profiled_method, int profiled_bci);
2218 void store_check(LIR_Opr object, LIR_Opr array, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, CodeEmitInfo* info_for_exception, ciMethod* profiled_method, int profiled_bci); 2244 void store_check(LIR_Opr object, LIR_Opr array, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, CodeEmitInfo* info_for_exception, ciMethod* profiled_method, int profiled_bci);