comparison src/share/vm/opto/mulnode.cpp @ 558:3b5ac9e7e6ea

6796746: rename LoadC (char) opcode class to LoadUS (unsigned short) Summary: Renaming LoadC to LoadUS would round up the planned introduction of LoadUB and LoadUI. Reviewed-by: phh, kvn
author twisti
date Mon, 26 Jan 2009 16:22:12 +0100
parents 78c058bc5cdc
children 7628781568e1
comparison
equal deleted inserted replaced
557:465813e0303a 558:3b5ac9e7e6ea
440 jint t1_support = ((jint)1 << (1 + log2_intptr(t1->_hi))) - 1; 440 jint t1_support = ((jint)1 << (1 + log2_intptr(t1->_hi))) - 1;
441 if ((t1_support & con) == t1_support) 441 if ((t1_support & con) == t1_support)
442 return load; 442 return load;
443 } 443 }
444 uint lop = load->Opcode(); 444 uint lop = load->Opcode();
445 if( lop == Op_LoadC && 445 if( lop == Op_LoadUS &&
446 con == 0x0000FFFF ) // Already zero-extended 446 con == 0x0000FFFF ) // Already zero-extended
447 return load; 447 return load;
448 // Masking off the high bits of a unsigned-shift-right is not 448 // Masking off the high bits of a unsigned-shift-right is not
449 // needed either. 449 // needed either.
450 if( lop == Op_URShiftI ) { 450 if( lop == Op_URShiftI ) {
468 const int mask = t2->get_con(); 468 const int mask = t2->get_con();
469 Node *load = in(1); 469 Node *load = in(1);
470 uint lop = load->Opcode(); 470 uint lop = load->Opcode();
471 471
472 // Masking bits off of a Character? Hi bits are already zero. 472 // Masking bits off of a Character? Hi bits are already zero.
473 if( lop == Op_LoadC && 473 if( lop == Op_LoadUS &&
474 (mask & 0xFFFF0000) ) // Can we make a smaller mask? 474 (mask & 0xFFFF0000) ) // Can we make a smaller mask?
475 return new (phase->C, 3) AndINode(load,phase->intcon(mask&0xFFFF)); 475 return new (phase->C, 3) AndINode(load,phase->intcon(mask&0xFFFF));
476 476
477 // Masking bits off of a Short? Loading a Character does some masking 477 // Masking bits off of a Short? Loading a Character does some masking
478 if( lop == Op_LoadS && 478 if( lop == Op_LoadS &&
479 (mask & 0xFFFF0000) == 0 ) { 479 (mask & 0xFFFF0000) == 0 ) {
480 Node *ldc = new (phase->C, 3) LoadCNode(load->in(MemNode::Control), 480 Node *ldus = new (phase->C, 3) LoadUSNode(load->in(MemNode::Control),
481 load->in(MemNode::Memory), 481 load->in(MemNode::Memory),
482 load->in(MemNode::Address), 482 load->in(MemNode::Address),
483 load->adr_type()); 483 load->adr_type());
484 ldc = phase->transform(ldc); 484 ldus = phase->transform(ldus);
485 return new (phase->C, 3) AndINode(ldc,phase->intcon(mask&0xFFFF)); 485 return new (phase->C, 3) AndINode(ldus, phase->intcon(mask&0xFFFF));
486 } 486 }
487 487
488 // Masking sign bits off of a Byte? Let the matcher use an unsigned load 488 // Masking sign bits off of a Byte? Let the matcher use an unsigned load
489 if( lop == Op_LoadB && 489 if( lop == Op_LoadB &&
490 (!in(0) && load->in(0)) && 490 (!in(0) && load->in(0)) &&
911 // combined optimization requires Identity only return direct inputs. 911 // combined optimization requires Identity only return direct inputs.
912 set_req(1, ld); 912 set_req(1, ld);
913 set_req(2, phase->intcon(0)); 913 set_req(2, phase->intcon(0));
914 return this; 914 return this;
915 } 915 }
916 else if( ld->Opcode() == Op_LoadC ) 916 else if( ld->Opcode() == Op_LoadUS )
917 // Replace zero-extension-load with sign-extension-load 917 // Replace zero-extension-load with sign-extension-load
918 return new (phase->C, 3) LoadSNode( ld->in(MemNode::Control), 918 return new (phase->C, 3) LoadSNode( ld->in(MemNode::Control),
919 ld->in(MemNode::Memory), 919 ld->in(MemNode::Memory),
920 ld->in(MemNode::Address), 920 ld->in(MemNode::Address),
921 ld->adr_type()); 921 ld->adr_type());