[Mono-dev] x86 code generator

Rusmin Susanto rusminsusanto at yahoo.com
Sun Jul 2 20:53:14 EDT 2006


Hello
   
  In file x86-codegen.h there are a lot of macros for x86 code generation. I am surprised that I don't see x86 assembly code here.
   
  Here are some of my questions:
   
  1. How do you know that floating point addition equal to :
   x86_fp_op_reg (code, X86_FADD, 1, TRUE);
     which is equal to:
   
   do { \
  static const unsigned char map[] = { 0, 1, 2, 3, 5, 4, 7, 6, 8}; \
  *(inst)++ = (pop_stack) ? (unsigned char)0xde : (unsigned char)0xdc; \
  *(inst)++ = (unsigned char)0xc0+(map[(opc)]<<3)+((index)&0x07); \ 
 } while (0)
     
   Where do you get the reference for this?
   
  2. How do you know that "sin" function is equal to the following instructions in x86:
   
   x86_fsin (code);
 x86_fldz (code);
 x86_fp_op_reg (code, X86_FADD, 1, TRUE);
   
   I can't find reference about this. Where do you get this reference?
   
  3. Why do you write everything in
   
     do .. while(0)   pattern?
   
     while(0) will always fail (I think). So there is no loop
   
  In short, I want to know where you get all these information because I can't find them in assembly reference/guide that I have.
   
  Is any good reference that explains all of these?
   
  Many thanks for your attention
   
   
  
Rusmin

 		
---------------------------------
Do you Yahoo!?
 Next-gen email? Have it all with the  all-new Yahoo! Mail Beta.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060702/5e50aed9/attachment.html 


More information about the Mono-devel-list mailing list