Mercurial > hg > truffle
comparison src/share/vm/opto/compile.cpp @ 2401:7e88bdae86ec
7029017: Additional architecture support for c2 compiler
Summary: Enables cross building of a c2 VM. Support masking of shift counts when the processor architecture mandates it.
Reviewed-by: kvn, never
author | roland |
---|---|
date | Fri, 25 Mar 2011 09:35:39 +0100 |
parents | c7f3d0b4570f |
children | 08eb13460b3a 92add02409c9 |
comparison
equal
deleted
inserted
replaced
2399:b2949bf39900 | 2401:7e88bdae86ec |
---|---|
2542 case Op_CountedLoop: | 2542 case Op_CountedLoop: |
2543 if (n->as_Loop()->is_inner_loop()) { | 2543 if (n->as_Loop()->is_inner_loop()) { |
2544 frc.inc_inner_loop_count(); | 2544 frc.inc_inner_loop_count(); |
2545 } | 2545 } |
2546 break; | 2546 break; |
2547 case Op_LShiftI: | |
2548 case Op_RShiftI: | |
2549 case Op_URShiftI: | |
2550 case Op_LShiftL: | |
2551 case Op_RShiftL: | |
2552 case Op_URShiftL: | |
2553 if (Matcher::need_masked_shift_count) { | |
2554 // The cpu's shift instructions don't restrict the count to the | |
2555 // lower 5/6 bits. We need to do the masking ourselves. | |
2556 Node* in2 = n->in(2); | |
2557 juint mask = (n->bottom_type() == TypeInt::INT) ? (BitsPerInt - 1) : (BitsPerLong - 1); | |
2558 const TypeInt* t = in2->find_int_type(); | |
2559 if (t != NULL && t->is_con()) { | |
2560 juint shift = t->get_con(); | |
2561 if (shift > mask) { // Unsigned cmp | |
2562 Compile* C = Compile::current(); | |
2563 n->set_req(2, ConNode::make(C, TypeInt::make(shift & mask))); | |
2564 } | |
2565 } else { | |
2566 if (t == NULL || t->_lo < 0 || t->_hi > (int)mask) { | |
2567 Compile* C = Compile::current(); | |
2568 Node* shift = new (C, 3) AndINode(in2, ConNode::make(C, TypeInt::make(mask))); | |
2569 n->set_req(2, shift); | |
2570 } | |
2571 } | |
2572 if (in2->outcnt() == 0) { // Remove dead node | |
2573 in2->disconnect_inputs(NULL); | |
2574 } | |
2575 } | |
2576 break; | |
2547 default: | 2577 default: |
2548 assert( !n->is_Call(), "" ); | 2578 assert( !n->is_Call(), "" ); |
2549 assert( !n->is_Mem(), "" ); | 2579 assert( !n->is_Mem(), "" ); |
2550 break; | 2580 break; |
2551 } | 2581 } |