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

Diff of /qemu/target-i386/op.c

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

revision 1.26 by bellard, Thu Jan 6 20:46:58 2005 UTC revision 1.27 by bellard, Sat Jan 8 18:58:29 2005 UTC
# Line 752  void OPPROTO op_movswl_T0_T0(void) Line 752  void OPPROTO op_movswl_T0_T0(void)
752      T0 = (int16_t)T0;      T0 = (int16_t)T0;
753  }  }
754    
 void OPPROTO op_movslq_T0_T0(void)  
 {  
     T0 = (int32_t)T0;  
 }  
   
755  void OPPROTO op_movzwl_T0_T0(void)  void OPPROTO op_movzwl_T0_T0(void)
756  {  {
757      T0 = (uint16_t)T0;      T0 = (uint16_t)T0;
# Line 768  void OPPROTO op_movswl_EAX_AX(void) Line 763  void OPPROTO op_movswl_EAX_AX(void)
763  }  }
764    
765  #ifdef TARGET_X86_64  #ifdef TARGET_X86_64
766    void OPPROTO op_movslq_T0_T0(void)
767    {
768        T0 = (int32_t)T0;
769    }
770    
771  void OPPROTO op_movslq_RAX_EAX(void)  void OPPROTO op_movslq_RAX_EAX(void)
772  {  {
773      EAX = (int32_t)EAX;      EAX = (int32_t)EAX;
# Line 1695  void OPPROTO op_flds_ST0_A0(void) Line 1695  void OPPROTO op_flds_ST0_A0(void)
1695      new_fpstt = (env->fpstt - 1) & 7;      new_fpstt = (env->fpstt - 1) & 7;
1696  #ifdef USE_FP_CONVERT  #ifdef USE_FP_CONVERT
1697      FP_CONVERT.i32 = ldl(A0);      FP_CONVERT.i32 = ldl(A0);
1698      env->fpregs[new_fpstt] = FP_CONVERT.f;      env->fpregs[new_fpstt].d = FP_CONVERT.f;
1699  #else  #else
1700      env->fpregs[new_fpstt] = ldfl(A0);      env->fpregs[new_fpstt].d = ldfl(A0);
1701  #endif  #endif
1702      env->fpstt = new_fpstt;      env->fpstt = new_fpstt;
1703      env->fptags[new_fpstt] = 0; /* validate stack entry */      env->fptags[new_fpstt] = 0; /* validate stack entry */
# Line 1709  void OPPROTO op_fldl_ST0_A0(void) Line 1709  void OPPROTO op_fldl_ST0_A0(void)
1709      new_fpstt = (env->fpstt - 1) & 7;      new_fpstt = (env->fpstt - 1) & 7;
1710  #ifdef USE_FP_CONVERT  #ifdef USE_FP_CONVERT
1711      FP_CONVERT.i64 = ldq(A0);      FP_CONVERT.i64 = ldq(A0);
1712      env->fpregs[new_fpstt] = FP_CONVERT.d;      env->fpregs[new_fpstt].d = FP_CONVERT.d;
1713  #else  #else
1714      env->fpregs[new_fpstt] = ldfq(A0);      env->fpregs[new_fpstt].d = ldfq(A0);
1715  #endif  #endif
1716      env->fpstt = new_fpstt;      env->fpstt = new_fpstt;
1717      env->fptags[new_fpstt] = 0; /* validate stack entry */      env->fptags[new_fpstt] = 0; /* validate stack entry */
# Line 1729  void helper_fild_ST0_A0(void) Line 1729  void helper_fild_ST0_A0(void)
1729  {  {
1730      int new_fpstt;      int new_fpstt;
1731      new_fpstt = (env->fpstt - 1) & 7;      new_fpstt = (env->fpstt - 1) & 7;
1732      env->fpregs[new_fpstt] = (CPU86_LDouble)ldsw(A0);      env->fpregs[new_fpstt].d = (CPU86_LDouble)ldsw(A0);
1733      env->fpstt = new_fpstt;      env->fpstt = new_fpstt;
1734      env->fptags[new_fpstt] = 0; /* validate stack entry */      env->fptags[new_fpstt] = 0; /* validate stack entry */
1735  }  }
# Line 1738  void helper_fildl_ST0_A0(void) Line 1738  void helper_fildl_ST0_A0(void)
1738  {  {
1739      int new_fpstt;      int new_fpstt;
1740      new_fpstt = (env->fpstt - 1) & 7;      new_fpstt = (env->fpstt - 1) & 7;
1741      env->fpregs[new_fpstt] = (CPU86_LDouble)((int32_t)ldl(A0));      env->fpregs[new_fpstt].d = (CPU86_LDouble)((int32_t)ldl(A0));
1742      env->fpstt = new_fpstt;      env->fpstt = new_fpstt;
1743      env->fptags[new_fpstt] = 0; /* validate stack entry */      env->fptags[new_fpstt] = 0; /* validate stack entry */
1744  }  }
# Line 1747  void helper_fildll_ST0_A0(void) Line 1747  void helper_fildll_ST0_A0(void)
1747  {  {
1748      int new_fpstt;      int new_fpstt;
1749      new_fpstt = (env->fpstt - 1) & 7;      new_fpstt = (env->fpstt - 1) & 7;
1750      env->fpregs[new_fpstt] = (CPU86_LDouble)((int64_t)ldq(A0));      env->fpregs[new_fpstt].d = (CPU86_LDouble)((int64_t)ldq(A0));
1751      env->fpstt = new_fpstt;      env->fpstt = new_fpstt;
1752      env->fptags[new_fpstt] = 0; /* validate stack entry */      env->fptags[new_fpstt] = 0; /* validate stack entry */
1753  }  }
# Line 1775  void OPPROTO op_fild_ST0_A0(void) Line 1775  void OPPROTO op_fild_ST0_A0(void)
1775      new_fpstt = (env->fpstt - 1) & 7;      new_fpstt = (env->fpstt - 1) & 7;
1776  #ifdef USE_FP_CONVERT  #ifdef USE_FP_CONVERT
1777      FP_CONVERT.i32 = ldsw(A0);      FP_CONVERT.i32 = ldsw(A0);
1778      env->fpregs[new_fpstt] = (CPU86_LDouble)FP_CONVERT.i32;      env->fpregs[new_fpstt].d = (CPU86_LDouble)FP_CONVERT.i32;
1779  #else  #else
1780      env->fpregs[new_fpstt] = (CPU86_LDouble)ldsw(A0);      env->fpregs[new_fpstt].d = (CPU86_LDouble)ldsw(A0);
1781  #endif  #endif
1782      env->fpstt = new_fpstt;      env->fpstt = new_fpstt;
1783      env->fptags[new_fpstt] = 0; /* validate stack entry */      env->fptags[new_fpstt] = 0; /* validate stack entry */
# Line 1789  void OPPROTO op_fildl_ST0_A0(void) Line 1789  void OPPROTO op_fildl_ST0_A0(void)
1789      new_fpstt = (env->fpstt - 1) & 7;      new_fpstt = (env->fpstt - 1) & 7;
1790  #ifdef USE_FP_CONVERT  #ifdef USE_FP_CONVERT
1791      FP_CONVERT.i32 = (int32_t) ldl(A0);      FP_CONVERT.i32 = (int32_t) ldl(A0);
1792      env->fpregs[new_fpstt] = (CPU86_LDouble)FP_CONVERT.i32;      env->fpregs[new_fpstt].d = (CPU86_LDouble)FP_CONVERT.i32;
1793  #else  #else
1794      env->fpregs[new_fpstt] = (CPU86_LDouble)((int32_t)ldl(A0));      env->fpregs[new_fpstt].d = (CPU86_LDouble)((int32_t)ldl(A0));
1795  #endif  #endif
1796      env->fpstt = new_fpstt;      env->fpstt = new_fpstt;
1797      env->fptags[new_fpstt] = 0; /* validate stack entry */      env->fptags[new_fpstt] = 0; /* validate stack entry */
# Line 1803  void OPPROTO op_fildll_ST0_A0(void) Line 1803  void OPPROTO op_fildll_ST0_A0(void)
1803      new_fpstt = (env->fpstt - 1) & 7;      new_fpstt = (env->fpstt - 1) & 7;
1804  #ifdef USE_FP_CONVERT  #ifdef USE_FP_CONVERT
1805      FP_CONVERT.i64 = (int64_t) ldq(A0);      FP_CONVERT.i64 = (int64_t) ldq(A0);
1806      env->fpregs[new_fpstt] = (CPU86_LDouble)FP_CONVERT.i64;      env->fpregs[new_fpstt].d = (CPU86_LDouble)FP_CONVERT.i64;
1807  #else  #else
1808      env->fpregs[new_fpstt] = (CPU86_LDouble)((int64_t)ldq(A0));      env->fpregs[new_fpstt].d = (CPU86_LDouble)((int64_t)ldq(A0));
1809  #endif  #endif
1810      env->fpstt = new_fpstt;      env->fpstt = new_fpstt;
1811      env->fptags[new_fpstt] = 0; /* validate stack entry */      env->fptags[new_fpstt] = 0; /* validate stack entry */
# Line 2322  void OPPROTO op_movo(void) Line 2322  void OPPROTO op_movo(void)
2322      memcpy16(d, s);      memcpy16(d, s);
2323  }  }
2324    
2325    void OPPROTO op_movq(void)
2326    {
2327        uint64_t *d, *s;
2328        d = (uint64_t *)((char *)env + PARAM1);
2329        s = (uint64_t *)((char *)env + PARAM2);
2330        *d = *s;
2331    }
2332    
2333    void OPPROTO op_movl(void)
2334    {
2335        uint32_t *d, *s;
2336        d = (uint32_t *)((char *)env + PARAM1);
2337        s = (uint32_t *)((char *)env + PARAM2);
2338        *d = *s;
2339    }
2340    
2341    void OPPROTO op_movq_env_0(void)
2342    {
2343        uint64_t *d;
2344        d = (uint64_t *)((char *)env + PARAM1);
2345        *d = 0;
2346    }
2347    
2348  void OPPROTO op_fxsave_A0(void)  void OPPROTO op_fxsave_A0(void)
2349  {  {
2350      helper_fxsave(A0, PARAM1);      helper_fxsave(A0, PARAM1);
# Line 2331  void OPPROTO op_fxrstor_A0(void) Line 2354  void OPPROTO op_fxrstor_A0(void)
2354  {  {
2355      helper_fxrstor(A0, PARAM1);      helper_fxrstor(A0, PARAM1);
2356  }  }
2357    
2358    /* XXX: optimize by storing fptt and fptags in the static cpu state */
2359    void OPPROTO op_enter_mmx(void)
2360    {
2361        env->fpstt = 0;
2362        *(uint32_t *)(env->fptags) = 0;
2363        *(uint32_t *)(env->fptags + 4) = 0;
2364    }
2365    
2366    void OPPROTO op_emms(void)
2367    {
2368        /* set to empty state */
2369        *(uint32_t *)(env->fptags) = 0x01010101;
2370        *(uint32_t *)(env->fptags + 4) = 0x01010101;
2371    }
2372    
2373    #define SHIFT 0
2374    #include "ops_sse.h"
2375    
2376    #define SHIFT 1
2377    #include "ops_sse.h"

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

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