mips: _emit_slt() and _emit_movn()
authorGuillaume Emont <guijemont@igalia.com>
Thu, 22 Nov 2012 18:38:33 +0000 (19:38 +0100)
committerGuillaume Emont <guijemont@igalia.com>
Fri, 28 Dec 2012 14:17:46 +0000 (15:17 +0100)
orc/orcmips.c
orc/orcmips.h

index 01a107d..e74e445 100644 (file)
@@ -548,3 +548,35 @@ orc_mips_emit_extr_s_h (OrcCompiler *compiler,
                  | 016 << 6 /* EXTR_S.H */
                  | 070); /* EXTR.W */
 }
+
+void
+orc_mips_emit_slt (OrcCompiler *compiler,
+                   OrcMipsRegister dest,
+                   OrcMipsRegister src1,
+                   OrcMipsRegister src2)
+{
+  ORC_ASM_CODE (compiler, "  slt     %s, %s, %s\n",
+                orc_mips_reg_name (dest),
+                orc_mips_reg_name (src1),
+                orc_mips_reg_name (src2));
+  orc_mips_emit (compiler,
+                 MIPS_BINARY_INSTRUCTION (0, /* SPECIAL */
+                                          src1, src2, dest, 0,
+                                          052)); /* SLT */
+}
+
+void
+orc_mips_emit_movn (OrcCompiler *compiler,
+                    OrcMipsRegister dest,
+                    OrcMipsRegister src,
+                    OrcMipsRegister condition)
+{
+  ORC_ASM_CODE (compiler, "  movn    %s, %s, %s\n",
+                orc_mips_reg_name (dest),
+                orc_mips_reg_name (src),
+                orc_mips_reg_name (condition));
+  orc_mips_emit (compiler,
+                 MIPS_BINARY_INSTRUCTION (0, /* SPECIAL */
+                                          src, condition, dest, 0,
+                                          013)); /* MOVN */
+}
index c28b656..b22b332 100644 (file)
@@ -124,6 +124,9 @@ void orc_mips_emit_mtlo (OrcCompiler *compiler, OrcMipsRegister source);
 
 void orc_mips_emit_extr_s_h (OrcCompiler *compiler, OrcMipsRegister dest, int accumulator, int shift);
 
+void orc_mips_emit_slt (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister src1, OrcMipsRegister src2);
+void orc_mips_emit_movn (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister src, OrcMipsRegister condition);
+
 void orc_mips_emit_align (OrcCompiler *compiler, int align_shift);
 
 void orc_mips_do_fixups (OrcCompiler *compiler);