# New Ticket Created by  Stephane Peiry 
# Please include the string:  [perl #31721]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=31721 >



This patch implements some compare ops (eq, ne, lt, le, gt, ge on
integers - template cmp_ix_ix_ic), for the JIT core on Sun/SPARC.
Thanks,
Stephane

Index: jit/sun4/core.jit
===================================================================
RCS file: /cvs/public/parrot/jit/sun4/core.jit,v
retrieving revision 1.6
diff -u -r1.6 core.jit
--- jit/sun4/core.jit   15 Mar 2004 13:15:44 -0000      1.6
+++ jit/sun4/core.jit   23 Sep 2004 18:40:28 -0000
@@ -583,6 +583,124 @@
     emitm_nop(NATIVECODE);
 }
 
+TEMPLATE Parrot_cmp_ix_ix_ic {
+    if(MAP[1] && MAP[2]){
+        emitm_subcc_r(NATIVECODE, MAP[1], MAP[2], emitm_g(0));
+    }
+    else if (MAP[1]) {
+        jit_emit_load_i(jit_info, interpreter, 2, ISR2);
+        emitm_subcc_r(NATIVECODE, MAP[1], ISR2, emitm_g(0));
+    }
+    else if (MAP[2]) {
+        jit_emit_load_i(jit_info, interpreter, 1, ISR1);
+        emitm_subcc_r(NATIVECODE, ISR1, MAP[2], emitm_g(0));
+    }
+    else {
+        jit_emit_load_i(jit_info, interpreter, 1, ISR1);
+        jit_emit_load_i(jit_info, interpreter, 2, ISR2);
+        emitm_subcc_r(NATIVECODE, ISR1, ISR2, emitm_g(0));
+    }
+
+    Parrot_jit_bicc(jit_info, emitm_<a>, 0, *INT_CONST[3]);
+    emitm_nop(NATIVECODE);
+}
+
+Parrot_eq_ic_ic_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/be/
+}
+
+Parrot_eq_i_ic_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/be/
+}
+
+Parrot_eq_ic_i_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/be/
+}
+
+Parrot_eq_i_i_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/be/
+}
+
+Parrot_ne_ic_ic_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/bne/
+}
+
+Parrot_ne_i_ic_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/bne/
+}
+
+Parrot_ne_ic_i_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/bne/
+}
+
+Parrot_ne_i_i_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/bne/
+}
+
+Parrot_lt_ic_ic_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/bl/
+}
+
+Parrot_lt_i_ic_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/bl/
+}
+
+Parrot_lt_ic_i_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/bl/
+}
+
+Parrot_lt_i_i_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/bl/
+}
+
+Parrot_le_ic_ic_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/ble/
+}
+
+Parrot_le_i_ic_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/ble/
+}
+
+Parrot_le_ic_i_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/ble/
+}
+
+Parrot_le_i_i_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/ble/
+}
+
+Parrot_gt_ic_ic_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/bg/
+}
+
+Parrot_gt_i_ic_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/bg/
+}
+
+Parrot_gt_ic_i_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/bg/
+}
+
+Parrot_gt_i_i_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/bg/
+}
+
+Parrot_ge_ic_ic_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/bge/
+}
+
+Parrot_ge_i_ic_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/bge/
+}
+
+Parrot_ge_ic_i_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/bge/
+}
+
+Parrot_ge_i_i_ic {
+    Parrot_cmp_ix_ix_ic  s/<a>/bge/
+}
+
 /*
  * Local variables:
  * c-indentation-style: bsd

Reply via email to