mips: emit functions for adduh_r.qb, rpelv.qb and packrl.ph
authorGuillaume Emont <guijemont@igalia.com>
Wed, 5 Dec 2012 18:17:49 +0000 (19:17 +0100)
committerGuillaume Emont <guijemont@igalia.com>
Fri, 28 Dec 2012 14:17:46 +0000 (15:17 +0100)
orc/orcmips.c
orc/orcmips.h

index d947b4b..8be81b0 100644 (file)
@@ -391,6 +391,22 @@ orc_mips_emit_addq_s_ph (OrcCompiler *compiler,
 }
 
 void
+orc_mips_emit_adduh_r_qb (OrcCompiler *compiler,
+                         OrcMipsRegister dest,
+                         OrcMipsRegister source1,
+                         OrcMipsRegister source2)
+{
+  ORC_ASM_CODE (compiler, "  adduh_r.qb %s, %s, %s\n",
+                orc_mips_reg_name (dest),
+                orc_mips_reg_name (source1),
+                orc_mips_reg_name (source2));
+  orc_mips_emit (compiler, MIPS_BINARY_INSTRUCTION(037, /* SPECIAL3 */
+                                                   source1, source2, dest,
+                                                   02, /* ADDUH_R */
+                                                   030 /* ADDUH.QB */));
+}
+
+void
 orc_mips_emit_ori (OrcCompiler *compiler,
                      OrcMipsRegister dest, OrcMipsRegister source, int value)
 {
@@ -684,6 +700,21 @@ orc_mips_emit_repl_ph (OrcCompiler *compiler, OrcMipsRegister dest, int value)
 }
 
 void
+orc_mips_emit_replv_qb (OrcCompiler *compiler,
+                        OrcMipsRegister dest,
+                        OrcMipsRegister source)
+{
+  ORC_ASM_CODE (compiler, "  replv.qb %s, %s\n",
+                orc_mips_reg_name (dest),
+                orc_mips_reg_name (source));
+  orc_mips_emit (compiler,
+                 MIPS_BINARY_INSTRUCTION(037, /* SPECIAL3 */
+                                         ORC_MIPS_ZERO, /* actually no reg here */
+                                         source, dest,
+                                         03, /* REPLV.QB */
+                                         022 /* ABSQ_S.PH */));
+}
+void
 orc_mips_emit_cmp_lt_ph (OrcCompiler *compiler,
                          OrcMipsRegister source1,
                          OrcMipsRegister source2)
@@ -719,3 +750,20 @@ orc_mips_emit_pick_ph (OrcCompiler *compiler,
                  | 021); /* CMPU.EQ.QB */
 }
 
+void
+orc_mips_emit_packrl_ph (OrcCompiler *compiler,
+                         OrcMipsRegister dest,
+                         OrcMipsRegister source1,
+                         OrcMipsRegister source2)
+{
+  ORC_ASM_CODE (compiler, "  packrl.ph %s, %s, %s\n",
+                orc_mips_reg_name (dest),
+                orc_mips_reg_name (source1),
+                orc_mips_reg_name (source2));
+  orc_mips_emit (compiler,
+                 MIPS_BINARY_INSTRUCTION(037, /* SPECIAL3 */
+                                         source1, source2, dest,
+                                         016, /* PACKRL.PH */
+                                         021 /* CMPU.EQ.QB */));
+}
+
index 01ad5c0..5e0f8de 100644 (file)
@@ -109,6 +109,7 @@ void orc_mips_emit_addu (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsReg
 void orc_mips_emit_addu_qb (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2);
 void orc_mips_emit_addu_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2);
 void orc_mips_emit_addq_s_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2);
+void orc_mips_emit_adduh_r_qb (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2);
 void orc_mips_emit_move (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source);
 void orc_mips_emit_sub (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2);
 void orc_mips_emit_subu_qb (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2);
@@ -138,9 +139,11 @@ void orc_mips_emit_slt (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegi
 void orc_mips_emit_movn (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister src, OrcMipsRegister condition);
 
 void orc_mips_emit_repl_ph (OrcCompiler *compiler, OrcMipsRegister dest, int value);
+void orc_mips_emit_replv_qb (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source);
 void orc_mips_emit_cmp_lt_ph (OrcCompiler *compiler, OrcMipsRegister source1, OrcMipsRegister source2);
 void orc_mips_emit_pick_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2);
 
+void orc_mips_emit_packrl_ph (OrcCompiler *compiler, OrcMipsRegister dest, OrcMipsRegister source1, OrcMipsRegister source2);
 void orc_mips_emit_align (OrcCompiler *compiler, int align_shift);
 
 void orc_mips_do_fixups (OrcCompiler *compiler);