Mercurial > hg > graal-compiler
diff src/cpu/x86/vm/assembler_x86.cpp @ 7474:00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
Summary: use 'rep stosb' instead of 'rep stosq' when fast-string operations are available.
Reviewed-by: twisti, roland
author | kvn |
---|---|
date | Thu, 03 Jan 2013 15:09:55 -0800 |
parents | d02120b7a34f |
children | e2e6bf86682c |
line wrap: on
line diff
--- a/src/cpu/x86/vm/assembler_x86.cpp Sun Dec 23 17:08:22 2012 +0100 +++ b/src/cpu/x86/vm/assembler_x86.cpp Thu Jan 03 15:09:55 2013 -0800 @@ -2544,12 +2544,18 @@ emit_int8((unsigned char)0xA5); } +// sets rcx bytes with rax, value at [edi] +void Assembler::rep_stosb() { + emit_int8((unsigned char)0xF3); // REP + LP64_ONLY(prefix(REX_W)); + emit_int8((unsigned char)0xAA); // STOSB +} + // sets rcx pointer sized words with rax, value at [edi] // generic -void Assembler::rep_set() { // rep_set - emit_int8((unsigned char)0xF3); - // STOSQ - LP64_ONLY(prefix(REX_W)); +void Assembler::rep_stos() { + emit_int8((unsigned char)0xF3); // REP + LP64_ONLY(prefix(REX_W)); // LP64:STOSQ, LP32:STOSD emit_int8((unsigned char)0xAB); }