summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2010-09-06 10:53:26 +0200
committerDavid Schleef <ds@schleef.org>2010-09-08 13:35:00 -0700
commitdccc2fae46b4b44aa4c9141fc78aa0f4049a07eb (patch)
tree5ffd9701c832855ab963af6288081d1d96e7b1c4
parent35d9452b9d32db3135e8ae1b129d9a1e26f08de4 (diff)
Add 64 bit addq/subq opcodes
-rw-r--r--orc/opcodes.h2
-rw-r--r--orc/orcemulateopcodes.c58
-rw-r--r--orc/orcemulateopcodes.h2
-rw-r--r--orc/orcopcodes.c2
4 files changed, 64 insertions, 0 deletions
diff --git a/orc/opcodes.h b/orc/opcodes.h
index 92a066e..20cc1bc 100644
--- a/orc/opcodes.h
+++ b/orc/opcodes.h
@@ -89,6 +89,8 @@ BINARY_SQ(andq, "%s & %s")
BINARY_SQ(andnq, "(~%s) & %s")
BINARY_SQ(orq, "%s | %s")
BINARY_SQ(xorq, "%s ^ %s")
+BINARY_SQ(addq, "%s + %s")
+BINARY_SQ(subq, "%s - %s")
UNARY_BW(convsbw, "%s")
UNARY_BW(convubw, "(orc_uint8)%s")
diff --git a/orc/orcemulateopcodes.c b/orc/orcemulateopcodes.c
index 6e6d533..785aa6d 100644
--- a/orc/orcemulateopcodes.c
+++ b/orc/orcemulateopcodes.c
@@ -3028,6 +3028,64 @@ emulate_xorq (OrcOpcodeExecutor *ex, int offset, int n)
}
void
+emulate_addq (OrcOpcodeExecutor *ex, int offset, int n)
+{
+ int i;
+ orc_union64 * ORC_RESTRICT ptr0;
+ const orc_union64 * ORC_RESTRICT ptr4;
+ const orc_union64 * ORC_RESTRICT ptr5;
+ orc_union64 var32;
+ orc_union64 var33;
+ orc_union64 var34;
+
+ ptr0 = (orc_union64 *)ex->dest_ptrs[0];
+ ptr4 = (orc_union64 *)ex->src_ptrs[0];
+ ptr5 = (orc_union64 *)ex->src_ptrs[1];
+
+
+ for (i = 0; i < n; i++) {
+ /* 0: loadq */
+ var32 = ptr4[i];
+ /* 1: loadq */
+ var33 = ptr5[i];
+ /* 2: addq */
+ var34.i = var32.i + var33.i;
+ /* 3: storeq */
+ ptr0[i] = var34;
+ }
+
+}
+
+void
+emulate_subq (OrcOpcodeExecutor *ex, int offset, int n)
+{
+ int i;
+ orc_union64 * ORC_RESTRICT ptr0;
+ const orc_union64 * ORC_RESTRICT ptr4;
+ const orc_union64 * ORC_RESTRICT ptr5;
+ orc_union64 var32;
+ orc_union64 var33;
+ orc_union64 var34;
+
+ ptr0 = (orc_union64 *)ex->dest_ptrs[0];
+ ptr4 = (orc_union64 *)ex->src_ptrs[0];
+ ptr5 = (orc_union64 *)ex->src_ptrs[1];
+
+
+ for (i = 0; i < n; i++) {
+ /* 0: loadq */
+ var32 = ptr4[i];
+ /* 1: loadq */
+ var33 = ptr5[i];
+ /* 2: subq */
+ var34.i = var32.i - var33.i;
+ /* 3: storeq */
+ ptr0[i] = var34;
+ }
+
+}
+
+void
emulate_convsbw (OrcOpcodeExecutor *ex, int offset, int n)
{
int i;
diff --git a/orc/orcemulateopcodes.h b/orc/orcemulateopcodes.h
index 38d1ff6..4f4df65 100644
--- a/orc/orcemulateopcodes.h
+++ b/orc/orcemulateopcodes.h
@@ -116,6 +116,8 @@ void emulate_andq (OrcOpcodeExecutor *ex, int i, int n);
void emulate_andnq (OrcOpcodeExecutor *ex, int i, int n);
void emulate_orq (OrcOpcodeExecutor *ex, int i, int n);
void emulate_xorq (OrcOpcodeExecutor *ex, int i, int n);
+void emulate_addq (OrcOpcodeExecutor *ex, int i, int n);
+void emulate_subq (OrcOpcodeExecutor *ex, int i, int n);
void emulate_convsbw (OrcOpcodeExecutor *ex, int i, int n);
void emulate_convubw (OrcOpcodeExecutor *ex, int i, int n);
void emulate_splatbw (OrcOpcodeExecutor *ex, int i, int n);
diff --git a/orc/orcopcodes.c b/orc/orcopcodes.c
index 41142a9..243ff0b 100644
--- a/orc/orcopcodes.c
+++ b/orc/orcopcodes.c
@@ -403,6 +403,8 @@ static OrcStaticOpcode opcodes[] = {
{ "andnq", 0, { 8 }, { 8, 8 }, emulate_andnq },
{ "orq", 0, { 8 }, { 8, 8 }, emulate_orq },
{ "xorq", 0, { 8 }, { 8, 8 }, emulate_xorq },
+ { "addq", 0, { 8 }, { 8, 8 }, emulate_addq },
+ { "subq", 0, { 8 }, { 8, 8 }, emulate_subq },
{ "convsbw", 0, { 2 }, { 1 }, emulate_convsbw },
{ "convubw", 0, { 2 }, { 1 }, emulate_convubw },