/[qemu]/qemu/op-i386.c
ViewVC logotype

Diff of /qemu/op-i386.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.34 by bellard, Mon Jun 9 15:24:58 2003 UTC revision 1.35 by bellard, Sun Jun 15 19:49:16 2003 UTC
# Line 19  Line 19 
19   */   */
20  #include "exec-i386.h"  #include "exec-i386.h"
21    
 uint8_t parity_table[256] = {  
     CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,  
     0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,  
     0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,  
     CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,  
     0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,  
     CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,  
     CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,  
     0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,  
     0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,  
     CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,  
     CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,  
     0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,  
     CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,  
     0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,  
     0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,  
     CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,  
     0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,  
     CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,  
     CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,  
     0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,  
     CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,  
     0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,  
     0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,  
     CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,  
     CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,  
     0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,  
     0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,  
     CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,  
     0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,  
     CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,  
     CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0,  
     0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,  
 };  
   
 /* modulo 17 table */  
 const uint8_t rclw_table[32] = {  
     0, 1, 2, 3, 4, 5, 6, 7,  
     8, 9,10,11,12,13,14,15,  
    16, 0, 1, 2, 3, 4, 5, 6,  
     7, 8, 9,10,11,12,13,14,  
 };  
   
 /* modulo 9 table */  
 const uint8_t rclb_table[32] = {  
     0, 1, 2, 3, 4, 5, 6, 7,  
     8, 0, 1, 2, 3, 4, 5, 6,  
     7, 8, 0, 1, 2, 3, 4, 5,  
     6, 7, 8, 0, 1, 2, 3, 4,  
 };  
   
22  /* n must be a constant to be efficient */  /* n must be a constant to be efficient */
23  static inline int lshift(int x, int n)  static inline int lshift(int x, int n)
24  {  {
# Line 624  void OPPROTO op_cmpxchg8b(void) Line 573  void OPPROTO op_cmpxchg8b(void)
573      helper_cmpxchg8b();      helper_cmpxchg8b();
574  }  }
575    
 #if defined(__powerpc__)  
   
 /* on PowerPC we patch the jump instruction directly */  
 #define JUMP_TB(tbparam, n, eip)\  
 do {\  
     static void __attribute__((unused)) *__op_label ## n = &&label ## n;\  
     asm volatile ("b %0" : : "i" (&__op_jmp ## n));\  
 label ## n:\  
     T0 = (long)(tbparam) + (n);\  
     EIP = eip;\  
 } while (0)  
   
 #else  
   
 /* jump to next block operations (more portable code, does not need  
    cache flushing, but slower because of indirect jump) */  
 #define JUMP_TB(tbparam, n, eip)\  
 do {\  
     static void __attribute__((unused)) *__op_label ## n = &&label ## n;\  
     goto *(void *)(((TranslationBlock *)tbparam)->tb_next[n]);\  
 label ## n:\  
     T0 = (long)(tbparam) + (n);\  
     EIP = eip;\  
 } while (0)  
   
 #endif  
   
576  void OPPROTO op_jmp_tb_next(void)  void OPPROTO op_jmp_tb_next(void)
577  {  {
578      JUMP_TB(PARAM1, 0, PARAM2);      JUMP_TB(PARAM1, 0, PARAM2);
# Line 1561  void OPPROTO op_fist_ST0_A0(void) Line 1483  void OPPROTO op_fist_ST0_A0(void)
1483    
1484      d = ST0;      d = ST0;
1485      val = lrint(d);      val = lrint(d);
1486        if (val != (int16_t)val)
1487            val = -32768;
1488      stw((void *)A0, val);      stw((void *)A0, val);
1489  }  }
1490    

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26