comparison src/cpu/x86/vm/x86_64.ad @ 643:c771b7f43bbf

6378821: bitCount() should use POPC on SPARC processors and AMD+10h Summary: bitCount() should use POPC on SPARC processors where POPC is implemented directly in hardware. Reviewed-by: kvn, never
author twisti
date Fri, 13 Mar 2009 11:35:17 -0700
parents 660978a2a31a
children c517646eef23
comparison
equal deleted inserted replaced
642:660978a2a31a 643:c771b7f43bbf
7427 opcode(0x0F, 0xC8, 0x89); /* Opcode 0F C8 89 */ 7427 opcode(0x0F, 0xC8, 0x89); /* Opcode 0F C8 89 */
7428 ins_encode( REX_reg_wide(src), OpcP, opc2_reg(src), REX_reg_mem_wide(src, dst), OpcT, reg_mem(src, dst) ); 7428 ins_encode( REX_reg_wide(src), OpcP, opc2_reg(src), REX_reg_mem_wide(src, dst), OpcT, reg_mem(src, dst) );
7429 ins_pipe( ialu_mem_reg ); 7429 ins_pipe( ialu_mem_reg );
7430 %} 7430 %}
7431 7431
7432
7433 //---------- Population Count Instructions -------------------------------------
7434
7435 instruct popCountI(rRegI dst, rRegI src) %{
7436 predicate(UsePopCountInstruction);
7437 match(Set dst (PopCountI src));
7438
7439 format %{ "popcnt $dst, $src" %}
7440 ins_encode %{
7441 __ popcntl($dst$$Register, $src$$Register);
7442 %}
7443 ins_pipe(ialu_reg);
7444 %}
7445
7446 instruct popCountI_mem(rRegI dst, memory mem) %{
7447 predicate(UsePopCountInstruction);
7448 match(Set dst (PopCountI (LoadI mem)));
7449
7450 format %{ "popcnt $dst, $mem" %}
7451 ins_encode %{
7452 __ popcntl($dst$$Register, $mem$$Address);
7453 %}
7454 ins_pipe(ialu_reg);
7455 %}
7456
7457 // Note: Long.bitCount(long) returns an int.
7458 instruct popCountL(rRegI dst, rRegL src) %{
7459 predicate(UsePopCountInstruction);
7460 match(Set dst (PopCountL src));
7461
7462 format %{ "popcnt $dst, $src" %}
7463 ins_encode %{
7464 __ popcntq($dst$$Register, $src$$Register);
7465 %}
7466 ins_pipe(ialu_reg);
7467 %}
7468
7469 // Note: Long.bitCount(long) returns an int.
7470 instruct popCountL_mem(rRegI dst, memory mem) %{
7471 predicate(UsePopCountInstruction);
7472 match(Set dst (PopCountL (LoadL mem)));
7473
7474 format %{ "popcnt $dst, $mem" %}
7475 ins_encode %{
7476 __ popcntq($dst$$Register, $mem$$Address);
7477 %}
7478 ins_pipe(ialu_reg);
7479 %}
7480
7481
7432 //----------MemBar Instructions----------------------------------------------- 7482 //----------MemBar Instructions-----------------------------------------------
7433 // Memory barrier flavors 7483 // Memory barrier flavors
7434 7484
7435 instruct membar_acquire() 7485 instruct membar_acquire()
7436 %{ 7486 %{