Mercurial > hg > graal-compiler
comparison 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 |
comparison
equal
deleted
inserted
replaced
7473:d092d1b31229 | 7474:00af3a3a8df4 |
---|---|
2542 // MOVSQ | 2542 // MOVSQ |
2543 LP64_ONLY(prefix(REX_W)); | 2543 LP64_ONLY(prefix(REX_W)); |
2544 emit_int8((unsigned char)0xA5); | 2544 emit_int8((unsigned char)0xA5); |
2545 } | 2545 } |
2546 | 2546 |
2547 // sets rcx bytes with rax, value at [edi] | |
2548 void Assembler::rep_stosb() { | |
2549 emit_int8((unsigned char)0xF3); // REP | |
2550 LP64_ONLY(prefix(REX_W)); | |
2551 emit_int8((unsigned char)0xAA); // STOSB | |
2552 } | |
2553 | |
2547 // sets rcx pointer sized words with rax, value at [edi] | 2554 // sets rcx pointer sized words with rax, value at [edi] |
2548 // generic | 2555 // generic |
2549 void Assembler::rep_set() { // rep_set | 2556 void Assembler::rep_stos() { |
2550 emit_int8((unsigned char)0xF3); | 2557 emit_int8((unsigned char)0xF3); // REP |
2551 // STOSQ | 2558 LP64_ONLY(prefix(REX_W)); // LP64:STOSQ, LP32:STOSD |
2552 LP64_ONLY(prefix(REX_W)); | |
2553 emit_int8((unsigned char)0xAB); | 2559 emit_int8((unsigned char)0xAB); |
2554 } | 2560 } |
2555 | 2561 |
2556 // scans rcx pointer sized words at [edi] for occurance of rax, | 2562 // scans rcx pointer sized words at [edi] for occurance of rax, |
2557 // generic | 2563 // generic |