10929 } else { 10930 bind(below_threshold); 10931 } 10932 10933 testl(len, len); 10934 jccb(Assembler::zero, done); 10935 lea(src, Address(src, len, Address::times_1)); 10936 lea(dst, Address(dst, len, Address::times_2)); 10937 negptr(len); 10938 10939 // inflate 1 char per iter 10940 bind(copy_chars_loop); 10941 load_unsigned_byte(tmp2, Address(src, len, Address::times_1)); // load byte char 10942 movw(Address(dst, len, Address::times_2), tmp2); // inflate byte char to word 10943 increment(len); 10944 jcc(Assembler::notZero, copy_chars_loop); 10945 10946 bind(done); 10947 } 10948 10949 Assembler::Condition MacroAssembler::negate_condition(Assembler::Condition cond) { 10950 switch (cond) { 10951 // Note some conditions are synonyms for others 10952 case Assembler::zero: return Assembler::notZero; 10953 case Assembler::notZero: return Assembler::zero; 10954 case Assembler::less: return Assembler::greaterEqual; 10955 case Assembler::lessEqual: return Assembler::greater; 10956 case Assembler::greater: return Assembler::lessEqual; 10957 case Assembler::greaterEqual: return Assembler::less; 10958 case Assembler::below: return Assembler::aboveEqual; 10959 case Assembler::belowEqual: return Assembler::above; 10960 case Assembler::above: return Assembler::belowEqual; 10961 case Assembler::aboveEqual: return Assembler::below; 10962 case Assembler::overflow: return Assembler::noOverflow; 10963 case Assembler::noOverflow: return Assembler::overflow; 10964 case Assembler::negative: return Assembler::positive; 10965 case Assembler::positive: return Assembler::negative; 10966 case Assembler::parity: return Assembler::noParity; 10967 case Assembler::noParity: return Assembler::parity; 10968 } | 10929 } else { 10930 bind(below_threshold); 10931 } 10932 10933 testl(len, len); 10934 jccb(Assembler::zero, done); 10935 lea(src, Address(src, len, Address::times_1)); 10936 lea(dst, Address(dst, len, Address::times_2)); 10937 negptr(len); 10938 10939 // inflate 1 char per iter 10940 bind(copy_chars_loop); 10941 load_unsigned_byte(tmp2, Address(src, len, Address::times_1)); // load byte char 10942 movw(Address(dst, len, Address::times_2), tmp2); // inflate byte char to word 10943 increment(len); 10944 jcc(Assembler::notZero, copy_chars_loop); 10945 10946 bind(done); 10947 } 10948 10949 void MacroAssembler::cache_wb(Address line) 10950 { 10951 // 64 bit cpus always support clflush 10952 assert(VM_Version::supports_clflush(), "should not reach here on 32-bit"); 10953 bool optimized = VM_Version::supports_clflushopt(); 10954 bool no_evict = VM_Version::supports_clwb(); 10955 10956 // pick the correct implementation 10957 10958 if (optimized) { 10959 if (no_evict) { 10960 clwb(line); 10961 } else { 10962 clflushopt(line); 10963 } 10964 } else { 10965 // no need for fence when using CLFLUSH 10966 clflush(line); 10967 } 10968 } 10969 10970 10971 void MacroAssembler::cache_wbsync(bool is_pre) 10972 { 10973 assert(VM_Version::supports_clflush(), "should not reach here on 32-bit"); 10974 bool optimized = VM_Version::supports_clflushopt(); 10975 bool no_evict = VM_Version::supports_clwb(); 10976 10977 // pick the correct implementation 10978 10979 if (!is_pre && (optimized || no_evict)) { 10980 // need an sfence for post flush when using clflushopt or clwb 10981 // otherwise no no need for any synchroniaztion 10982 10983 sfence(); 10984 } 10985 } 10986 10987 Assembler::Condition MacroAssembler::negate_condition(Assembler::Condition cond) { 10988 switch (cond) { 10989 // Note some conditions are synonyms for others 10990 case Assembler::zero: return Assembler::notZero; 10991 case Assembler::notZero: return Assembler::zero; 10992 case Assembler::less: return Assembler::greaterEqual; 10993 case Assembler::lessEqual: return Assembler::greater; 10994 case Assembler::greater: return Assembler::lessEqual; 10995 case Assembler::greaterEqual: return Assembler::less; 10996 case Assembler::below: return Assembler::aboveEqual; 10997 case Assembler::belowEqual: return Assembler::above; 10998 case Assembler::above: return Assembler::belowEqual; 10999 case Assembler::aboveEqual: return Assembler::below; 11000 case Assembler::overflow: return Assembler::noOverflow; 11001 case Assembler::noOverflow: return Assembler::overflow; 11002 case Assembler::negative: return Assembler::positive; 11003 case Assembler::positive: return Assembler::negative; 11004 case Assembler::parity: return Assembler::noParity; 11005 case Assembler::noParity: return Assembler::parity; 11006 } |