Author: leo
Date: Sun Feb 19 11:07:16 2006
New Revision: 11669

Modified:
   trunk/src/jit/i386/core.jit
   trunk/src/jit/i386/jit_emit.h
Log:
JIT/x86 - really implement JITted sin, cos, sqrt

* providing JIT code for non-existing ops doesn't help at all
  (the JIT compiler should warn here)
* <op>_n_n is the thing we need
* partialsums.pir is now ~30% faster than gcc (sse2) and ~70% faster than 
  gcc w shootout optimizations


Modified: trunk/src/jit/i386/core.jit
==============================================================================
--- trunk/src/jit/i386/core.jit (original)
+++ trunk/src/jit/i386/core.jit Sun Feb 19 11:07:16 2006
@@ -852,17 +852,6 @@ Parrot_neg_n {
     unary_x s/<_N>/_n/ s/INT/NUM/  s/<op>/neg/
 }
 
-Parrot_sin {
-    unary_x s/<_N>/_n/ s/INT/NUM/  s/<op>/sin/
-}
-
-Parrot_cos_n {
-    unary_x s/<_N>/_n/ s/INT/NUM/  s/<op>/cos/
-}
-
-Parrot_sqrt_n {
-    unary_x s/<_N>/_n/ s/INT/NUM/  s/<op>/sqrt/
-}
 
 Parrot_bnot_i {
     unary_x s/<_N>/_i/  s/<op>/not/
@@ -916,6 +905,18 @@ Parrot_abs_n_n {
     unary_x_x s/<_N>/_n/ s/ISR/FSR/ s/INT/NUM/ s/<op>/abs/
 }
 
+Parrot_sin_n_n {
+    unary_x_x s/<_N>/_n/ s/ISR/FSR/ s/INT/NUM/ s/<op>/sin/
+}
+
+Parrot_cos_n_n {
+    unary_x_x s/<_N>/_n/ s/ISR/FSR/ s/INT/NUM/ s/<op>/cos/
+}
+
+Parrot_sqrt_n_n {
+    unary_x_x s/<_N>/_n/ s/ISR/FSR/ s/INT/NUM/ s/<op>/sqrt/
+}
+
 
 TEMPLATE Parrot_ifunless_x_ic {
  /*

Modified: trunk/src/jit/i386/jit_emit.h
==============================================================================
--- trunk/src/jit/i386/jit_emit.h       (original)
+++ trunk/src/jit/i386/jit_emit.h       Sun Feb 19 11:07:16 2006
@@ -1259,16 +1259,16 @@ static unsigned char *lastpc;
      }
 #  endif
 
-#   define jit_emit_sin_n(pc, r) \
+#   define jit_emit_sin_r_n(pc, r) \
      if (r) { \
        emitm_fld(pc, r); \
      } \
-     emitm_fsqrt(pc); \
+     emitm_fsin(pc); \
      if (r) { \
        emitm_fstp(pc, (r+1)); \
      }
 
-#   define jit_emit_cos_n(pc, r) \
+#   define jit_emit_cos_r_n(pc, r) \
      if (r) { \
        emitm_fld(pc, r); \
      } \
@@ -1277,7 +1277,7 @@ static unsigned char *lastpc;
        emitm_fstp(pc, (r+1)); \
      }
 
-#   define jit_emit_sqrt_n(pc, r) \
+#   define jit_emit_sqrt_r_n(pc, r) \
      if (r) { \
        emitm_fld(pc, r); \
      } \

Reply via email to