[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pnet-developers] mk_local_n
From: |
Miroslaw Dobrzanski-Neumann |
Subject: |
[Pnet-developers] mk_local_n |
Date: |
Mon, 3 Nov 2003 13:23:36 +0100 |
User-agent: |
Mutt/1.4i |
Hi,
in the unroller there is not code code for COP_MK_LOCAL_N.
I have provided the following piece of code in unroll_var.c
and got about 9% better score in pnetmark.Logic on my P4
The Run() method has more than 3 local words
391 #ifdef CVM_X86
392 case COP_MK_LOCAL_N:
393 {
394 unsigned temp = CVM_ARG_WIDE_SMALL;
395 UNROLL_START();
396 FlushRegisterStack(&unroll);
397 if (X86_EDI == MD_REG_STACK && 0 == unroll.stackHeight) {
398 x86_clear_reg (unroll.out, X86_EAX);
399 x86_mov_reg_imm (unroll.out, X86_ECX, temp);
400 x86_prefix (unroll.out, X86_REPZ_PREFIX);
401 x86_stosl (unroll.out);
402 }
403 else {
404 unsigned idx;
405 md_clear_membase_start(unroll.out);
406 for (idx = 0; idx < temp; idx++) {
407 md_clear_membase(unroll.out, MD_REG_STACK, (idx *
sizeof(CVMWord)) + unroll.stackHeight);
408 }
409 }
410 unroll.stackHeight += temp * sizeof(CVMWord);
411 MODIFY_UNROLL_PC(CVM_LEN_WIDE_SMALL);
412 }
413 break;
414 #endif
Generally every method with more than 3 local words will benefit from this
piece of code such as:
System.Array::Copy ()
System.Text.StringBuilder::AppendSpace ()
This code bases on the documented assumption
mk_local_n:
...
Notes:
This instruction is used to allocate local variable space at the start of a
method.
So the scratch registers X86_EAX, X86_ECX have not been used before and it
is safe to use them directly
To get rid of the platform specific code (here x86) a new md_* macro is needed
md_clear_membase_len(inst,reg,pos,bytelen)
Could you verify and merge into cvs
Regards,
--
Mirosław Dobrzański-Neumann
E-mail: address@hidden
This message is utf-8 encoded
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pnet-developers] mk_local_n,
Miroslaw Dobrzanski-Neumann <=