Mercurial > hg > truffle
comparison src/cpu/x86/vm/c1_LIRAssembler_x86.cpp @ 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 | 46f6f063b272 |
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. |
3510 __ call_VM_leaf(entry, 0); | 3510 __ call_VM_leaf(entry, 0); |
3511 | 3511 |
3512 __ bind(*stub->continuation()); | 3512 __ bind(*stub->continuation()); |
3513 } | 3513 } |
3514 | 3514 |
3515 void LIR_Assembler::emit_updatecrc32(LIR_OpUpdateCRC32* op) { | |
3516 assert(op->crc()->is_single_cpu(), "crc must be register"); | |
3517 assert(op->val()->is_single_cpu(), "byte value must be register"); | |
3518 assert(op->result_opr()->is_single_cpu(), "result must be register"); | |
3519 Register crc = op->crc()->as_register(); | |
3520 Register val = op->val()->as_register(); | |
3521 Register res = op->result_opr()->as_register(); | |
3522 | |
3523 assert_different_registers(val, crc, res); | |
3524 | |
3525 __ lea(res, ExternalAddress(StubRoutines::crc_table_addr())); | |
3526 __ notl(crc); // ~crc | |
3527 __ update_byte_crc32(crc, val, res); | |
3528 __ notl(crc); // ~crc | |
3529 __ mov(res, crc); | |
3530 } | |
3515 | 3531 |
3516 void LIR_Assembler::emit_lock(LIR_OpLock* op) { | 3532 void LIR_Assembler::emit_lock(LIR_OpLock* op) { |
3517 Register obj = op->obj_opr()->as_register(); // may not be an oop | 3533 Register obj = op->obj_opr()->as_register(); // may not be an oop |
3518 Register hdr = op->hdr_opr()->as_register(); | 3534 Register hdr = op->hdr_opr()->as_register(); |
3519 Register lock = op->lock_opr()->as_register(); | 3535 Register lock = op->lock_opr()->as_register(); |