< prev index next >

src/hotspot/cpu/ppc/c2_MacroAssembler_ppc.cpp

Print this page

 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #include "precompiled.hpp"
 26 #include "asm/assembler.hpp"
 27 #include "asm/assembler.inline.hpp"
 28 #include "opto/c2_MacroAssembler.hpp"
 29 #include "opto/intrinsicnode.hpp"
 30 #include "runtime/vm_version.hpp"
 31 
 32 #ifdef PRODUCT
 33 #define BLOCK_COMMENT(str) // nothing
 34 #else
 35 #define BLOCK_COMMENT(str) block_comment(str)
 36 #endif
 37 #define BIND(label) bind(label); BLOCK_COMMENT(#label ":")
 38 











 39 // Intrinsics for CompactStrings
 40 
 41 // Compress char[] to byte[] by compressing 16 bytes at once.
 42 void C2_MacroAssembler::string_compress_16(Register src, Register dst, Register cnt,
 43                                            Register tmp1, Register tmp2, Register tmp3, Register tmp4, Register tmp5,
 44                                            Label& Lfailure, bool ascii) {
 45 
 46   const Register tmp0 = R0;
 47   const int byte_mask = ascii ? 0x7F : 0xFF;
 48   assert_different_registers(src, dst, cnt, tmp0, tmp1, tmp2, tmp3, tmp4, tmp5);
 49   Label Lloop, Lslow;
 50 
 51   // Check if cnt >= 8 (= 16 bytes)
 52   lis(tmp1, byte_mask);           // tmp1 = 0x00FF00FF00FF00FF (non ascii case)
 53   srwi_(tmp2, cnt, 3);
 54   beq(CCR0, Lslow);
 55   ori(tmp1, tmp1, byte_mask);
 56   rldimi(tmp1, tmp1, 32, 0);
 57   mtctr(tmp2);
 58 

 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #include "precompiled.hpp"
 26 #include "asm/assembler.hpp"
 27 #include "asm/assembler.inline.hpp"
 28 #include "opto/c2_MacroAssembler.hpp"
 29 #include "opto/intrinsicnode.hpp"
 30 #include "runtime/vm_version.hpp"
 31 
 32 #ifdef PRODUCT
 33 #define BLOCK_COMMENT(str) // nothing
 34 #else
 35 #define BLOCK_COMMENT(str) block_comment(str)
 36 #endif
 37 #define BIND(label) bind(label); BLOCK_COMMENT(#label ":")
 38 
 39 
 40 void C2_MacroAssembler::fast_lock_lightweight(ConditionRegister flag, Register obj, Register box,
 41                                               Register tmp1, Register tmp2, Register tmp3) {
 42   compiler_fast_lock_lightweight_object(flag, obj, tmp1, tmp2, tmp3);
 43 }
 44 
 45 void C2_MacroAssembler::fast_unlock_lightweight(ConditionRegister flag, Register obj, Register box,
 46                                                 Register tmp1, Register tmp2, Register tmp3) {
 47   compiler_fast_unlock_lightweight_object(flag, obj, tmp1, tmp2, tmp3);
 48 }
 49 
 50 // Intrinsics for CompactStrings
 51 
 52 // Compress char[] to byte[] by compressing 16 bytes at once.
 53 void C2_MacroAssembler::string_compress_16(Register src, Register dst, Register cnt,
 54                                            Register tmp1, Register tmp2, Register tmp3, Register tmp4, Register tmp5,
 55                                            Label& Lfailure, bool ascii) {
 56 
 57   const Register tmp0 = R0;
 58   const int byte_mask = ascii ? 0x7F : 0xFF;
 59   assert_different_registers(src, dst, cnt, tmp0, tmp1, tmp2, tmp3, tmp4, tmp5);
 60   Label Lloop, Lslow;
 61 
 62   // Check if cnt >= 8 (= 16 bytes)
 63   lis(tmp1, byte_mask);           // tmp1 = 0x00FF00FF00FF00FF (non ascii case)
 64   srwi_(tmp2, cnt, 3);
 65   beq(CCR0, Lslow);
 66   ori(tmp1, tmp1, byte_mask);
 67   rldimi(tmp1, tmp1, 32, 0);
 68   mtctr(tmp2);
 69 
< prev index next >