summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author DavidHaywood <28625134+DavidHaywood@users.noreply.github.com>2019-08-15 14:42:48 +0100
committer DavidHaywood <28625134+DavidHaywood@users.noreply.github.com>2019-08-15 14:42:48 +0100
commit639a5c1fe6d8e35ade989ee292aa080790911996 (patch)
tree8a80ef242e9ac2b3006ca71a0af7e4097bd5afd3 /src
parentd35c39bb165b7e2d3f23916ef2b220e6925f4f91 (diff)
don't use my ill-conceived generator for arcompact, easier to work with as regular files (nw)
Diffstat (limited to 'src')
-rw-r--r--src/devices/cpu/arcompact/arcompact_execute.cpp4434
-rw-r--r--src/devices/cpu/arcompact/arcompact_make.py435
2 files changed, 4433 insertions, 436 deletions
diff --git a/src/devices/cpu/arcompact/arcompact_execute.cpp b/src/devices/cpu/arcompact/arcompact_execute.cpp
index c341a856853..ebf48240e98 100644
--- a/src/devices/cpu/arcompact/arcompact_execute.cpp
+++ b/src/devices/cpu/arcompact/arcompact_execute.cpp
@@ -1846,7 +1846,4438 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_helper(OPS_32, const char
}
-#include "cpu/arcompact/arcompact.hxx"
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_00_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+ got_limm = 1;
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b + c;
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ if (result & 0x80000000) { STATUS32_SET_N; }
+ else { STATUS32_CLEAR_N; }
+ if (result == 0x00000000) { STATUS32_SET_Z; }
+ else { STATUS32_CLEAR_Z; }
+ if ((b & 0x80000000) == (c & 0x80000000))
+ {
+ if ((result & 0x80000000) != (b & 0x80000000))
+ {
+ STATUS32_SET_V;
+ }
+ else
+ {
+ STATUS32_CLEAR_V;
+ }
+ }
+ if (b < c)
+ {
+ STATUS32_SET_C;
+ }
+ else
+ {
+ STATUS32_CLEAR_C;
+ }
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_00_p01(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b + c;
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ if (result & 0x80000000) { STATUS32_SET_N; }
+ else { STATUS32_CLEAR_N; }
+ if (result == 0x00000000) { STATUS32_SET_Z; }
+ else { STATUS32_CLEAR_Z; }
+ if ((b & 0x80000000) == (c & 0x80000000))
+ {
+ if ((result & 0x80000000) != (b & 0x80000000))
+ {
+ STATUS32_SET_V;
+ }
+ else
+ {
+ STATUS32_CLEAR_V;
+ }
+ }
+ if (b < c)
+ {
+ STATUS32_SET_C;
+ }
+ else
+ {
+ STATUS32_CLEAR_C;
+ }
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_00_p10(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_s12;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = (uint32_t)S;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b + c;
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ if (result & 0x80000000) { STATUS32_SET_N; }
+ else { STATUS32_CLEAR_N; }
+ if (result == 0x00000000) { STATUS32_SET_Z; }
+ else { STATUS32_CLEAR_Z; }
+ if ((b & 0x80000000) == (c & 0x80000000))
+ {
+ if ((result & 0x80000000) != (b & 0x80000000))
+ {
+ STATUS32_SET_V;
+ }
+ else
+ {
+ STATUS32_CLEAR_V;
+ }
+ }
+ if (b < c)
+ {
+ STATUS32_SET_C;
+ }
+ else
+ {
+ STATUS32_CLEAR_C;
+ }
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_00_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("arcompact_handle04_00_p11_m0 (ADD)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_00_p11_m1(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as condition code select
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ COMMON32_GET_CONDITION;
+ if (!check_condition(condition))
+ return m_pc + (size>>0);
+
+ uint32_t result = b + c;
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ if (result & 0x80000000) { STATUS32_SET_N; }
+ else { STATUS32_CLEAR_N; }
+ if (result == 0x00000000) { STATUS32_SET_Z; }
+ else { STATUS32_CLEAR_Z; }
+ if ((b & 0x80000000) == (c & 0x80000000))
+ {
+ if ((result & 0x80000000) != (b & 0x80000000))
+ {
+ STATUS32_SET_V;
+ }
+ else
+ {
+ STATUS32_CLEAR_V;
+ }
+ }
+ if (b < c)
+ {
+ STATUS32_SET_C;
+ }
+ else
+ {
+ STATUS32_CLEAR_C;
+ }
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_02_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+ got_limm = 1;
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b - c;
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_02 (SUB) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_02_p01(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b - c;
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_02 (SUB) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_02_p10(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_s12;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = (uint32_t)S;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b - c;
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_02 (SUB) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_02_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("arcompact_handle04_02_p11_m0 (SUB)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_02_p11_m1(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as condition code select
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ COMMON32_GET_CONDITION;
+ if (!check_condition(condition))
+ return m_pc + (size>>0);
+
+ uint32_t result = b - c;
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_02 (SUB) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_04_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+ got_limm = 1;
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b & c;
+ if (areg != LIMM_REG) { m_regs[areg] = result; }
+
+ if (F)
+ {
+ if (result & 0x80000000) { STATUS32_SET_N; }
+ else { STATUS32_CLEAR_N; }
+ if (result == 0x00000000) { STATUS32_SET_Z; }
+ else { STATUS32_CLEAR_Z; }
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_04_p01(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b & c;
+ if (areg != LIMM_REG) { m_regs[areg] = result; }
+
+ if (F)
+ {
+ if (result & 0x80000000) { STATUS32_SET_N; }
+ else { STATUS32_CLEAR_N; }
+ if (result == 0x00000000) { STATUS32_SET_Z; }
+ else { STATUS32_CLEAR_Z; }
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_04_p10(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_s12;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = (uint32_t)S;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b & c;
+ if (breg != LIMM_REG) { m_regs[breg] = result; }
+
+ if (F)
+ {
+ if (result & 0x80000000) { STATUS32_SET_N; }
+ else { STATUS32_CLEAR_N; }
+ if (result == 0x00000000) { STATUS32_SET_Z; }
+ else { STATUS32_CLEAR_Z; }
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_04_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("arcompact_handle04_04_p11_m0 (AND)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_04_p11_m1(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as condition code select
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ COMMON32_GET_CONDITION;
+ if (!check_condition(condition))
+ return m_pc + (size>>0);
+
+ uint32_t result = b & c;
+ if (breg != LIMM_REG) { m_regs[breg] = result; }
+
+ if (F)
+ {
+ if (result & 0x80000000) { STATUS32_SET_N; }
+ else { STATUS32_CLEAR_N; }
+ if (result == 0x00000000) { STATUS32_SET_Z; }
+ else { STATUS32_CLEAR_Z; }
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_05_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+ got_limm = 1;
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b | c;
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_05 (OR) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_05_p01(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b | c;
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_05 (OR) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_05_p10(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_s12;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = (uint32_t)S;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b | c;
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_05 (OR) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_05_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("arcompact_handle04_05_p11_m0 (OR)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_05_p11_m1(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as condition code select
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ COMMON32_GET_CONDITION;
+ if (!check_condition(condition))
+ return m_pc + (size>>0);
+
+ uint32_t result = b | c;
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_05 (OR) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_06_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+ got_limm = 1;
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b & (~c);
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_06 (BIC) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_06_p01(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b & (~c);
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_06 (BIC) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_06_p10(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_s12;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = (uint32_t)S;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b & (~c);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_06 (BIC) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_06_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("arcompact_handle04_06_p11_m0 (BIC)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_06_p11_m1(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as condition code select
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ COMMON32_GET_CONDITION;
+ if (!check_condition(condition))
+ return m_pc + (size>>0);
+
+ uint32_t result = b & (~c);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_06 (BIC) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_07_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+ got_limm = 1;
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b ^ c;
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_07 (XOR) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_07_p01(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b ^ c;
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_07 (XOR) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_07_p10(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_s12;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = (uint32_t)S;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b ^ c;
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_07 (XOR) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_07_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("arcompact_handle04_07_p11_m0 (XOR)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_07_p11_m1(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as condition code select
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ COMMON32_GET_CONDITION;
+ if (!check_condition(condition))
+ return m_pc + (size>>0);
+
+ uint32_t result = b ^ c;
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_07 (XOR) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0a_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ //COMMON32_GET_areg; // areg is reserved / not used
+
+ uint32_t c;
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = c;
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ if (result & 0x80000000) { STATUS32_SET_N; }
+ else { STATUS32_CLEAR_N; }
+ if (result == 0x00000000) { STATUS32_SET_Z; }
+ else { STATUS32_CLEAR_Z; }
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0a_p01(OPS_32)
+{
+ int size = 4;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg is reserved / not used
+
+ uint32_t c;
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = c;
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ if (result & 0x80000000) { STATUS32_SET_N; }
+ else { STATUS32_CLEAR_N; }
+ if (result == 0x00000000) { STATUS32_SET_Z; }
+ else { STATUS32_CLEAR_Z; }
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0a_p10(OPS_32)
+{
+ int size = 4;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_s12;
+
+ uint32_t c;
+
+ c = (uint32_t)S;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = c;
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ if (result & 0x80000000) { STATUS32_SET_N; }
+ else { STATUS32_CLEAR_N; }
+ if (result == 0x00000000) { STATUS32_SET_Z; }
+ else { STATUS32_CLEAR_Z; }
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0a_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("arcompact_handle04_0a_p11_m0 (MOV)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0a_p11_m1(OPS_32)
+{
+ int size = 4;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as condition code select
+
+ uint32_t c;
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ COMMON32_GET_CONDITION;
+ if (!check_condition(condition))
+ return m_pc + (size>>0);
+
+ uint32_t result = c;
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ if (result & 0x80000000) { STATUS32_SET_N; }
+ else { STATUS32_CLEAR_N; }
+ if (result == 0x00000000) { STATUS32_SET_Z; }
+ else { STATUS32_CLEAR_Z; }
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0e_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+ got_limm = 1;
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = c - b;
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_0e (RSUB) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0e_p01(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = c - b;
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_0e (RSUB) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0e_p10(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_s12;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = (uint32_t)S;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = c - b;
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_0e (RSUB) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0e_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("arcompact_handle04_0e_p11_m0 (RSUB)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0e_p11_m1(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as condition code select
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ COMMON32_GET_CONDITION;
+ if (!check_condition(condition))
+ return m_pc + (size>>0);
+
+ uint32_t result = c - b;
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_0e (RSUB) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0f_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+ got_limm = 1;
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b | (1 << (c & 0x1f));
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_0f (BSET) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0f_p01(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b | (1 << (c & 0x1f));
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_0f (BSET) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0f_p10(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_s12;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = (uint32_t)S;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b | (1 << (c & 0x1f));
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_0f (BSET) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0f_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("arcompact_handle04_0f_p11_m0 (BSET)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_0f_p11_m1(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as condition code select
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ COMMON32_GET_CONDITION;
+ if (!check_condition(condition))
+ return m_pc + (size>>0);
+
+ uint32_t result = b | (1 << (c & 0x1f));
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_0f (BSET) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_13_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+ got_limm = 1;
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b & ((1<<(c+1))-1);
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_13 (BMSK) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_13_p01(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b & ((1<<(c+1))-1);
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_13 (BMSK) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_13_p10(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_s12;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = (uint32_t)S;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b & ((1<<(c+1))-1);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_13 (BMSK) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_13_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("arcompact_handle04_13_p11_m0 (BMSK)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_13_p11_m1(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as condition code select
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ COMMON32_GET_CONDITION;
+ if (!check_condition(condition))
+ return m_pc + (size>>0);
+
+ uint32_t result = b & ((1<<(c+1))-1);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_13 (BMSK) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_14_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+ got_limm = 1;
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b + (c << 1);
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_14 (ADD1) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_14_p01(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b + (c << 1);
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_14 (ADD1) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_14_p10(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_s12;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = (uint32_t)S;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b + (c << 1);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_14 (ADD1) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_14_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("arcompact_handle04_14_p11_m0 (ADD1)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_14_p11_m1(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as condition code select
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ COMMON32_GET_CONDITION;
+ if (!check_condition(condition))
+ return m_pc + (size>>0);
+
+ uint32_t result = b + (c << 1);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_14 (ADD1) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_15_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+ got_limm = 1;
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b + (c << 2);
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_15 (ADD2) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_15_p01(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b + (c << 2);
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_15 (ADD2) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_15_p10(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_s12;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = (uint32_t)S;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b + (c << 2);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_15 (ADD2) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_15_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("arcompact_handle04_15_p11_m0 (ADD2)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_15_p11_m1(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as condition code select
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ COMMON32_GET_CONDITION;
+ if (!check_condition(condition))
+ return m_pc + (size>>0);
+
+ uint32_t result = b + (c << 2);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_15 (ADD2) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_16_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+ got_limm = 1;
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b + (c << 3);
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_16 (ADD3) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_16_p01(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b + (c << 3);
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_16 (ADD3) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_16_p10(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_s12;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = (uint32_t)S;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b + (c << 3);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_16 (ADD3) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_16_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("arcompact_handle04_16_p11_m0 (ADD3)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_16_p11_m1(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as condition code select
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ COMMON32_GET_CONDITION;
+ if (!check_condition(condition))
+ return m_pc + (size>>0);
+
+ uint32_t result = b + (c << 3);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_16 (ADD3) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_17_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+ got_limm = 1;
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b - (c << 1);
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_17 (SUB1) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_17_p01(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b - (c << 1);
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_17 (SUB1) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_17_p10(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_s12;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = (uint32_t)S;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b - (c << 1);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_17 (SUB1) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_17_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("arcompact_handle04_17_p11_m0 (SUB1)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_17_p11_m1(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as condition code select
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ COMMON32_GET_CONDITION;
+ if (!check_condition(condition))
+ return m_pc + (size>>0);
+
+ uint32_t result = b - (c << 1);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_17 (SUB1) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_18_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+ got_limm = 1;
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b - (c << 2);
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_18 (SUB2) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_18_p01(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b - (c << 2);
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_18 (SUB2) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_18_p10(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_s12;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = (uint32_t)S;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b - (c << 2);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_18 (SUB2) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_18_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("arcompact_handle04_18_p11_m0 (SUB2)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_18_p11_m1(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as condition code select
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ COMMON32_GET_CONDITION;
+ if (!check_condition(condition))
+ return m_pc + (size>>0);
+
+ uint32_t result = b - (c << 2);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_18 (SUB2) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_19_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+ got_limm = 1;
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b - (c << 3);
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_19 (SUB3) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_19_p01(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b - (c << 3);
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_19 (SUB3) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_19_p10(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_s12;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = (uint32_t)S;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b - (c << 3);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_19 (SUB3) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_19_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("arcompact_handle04_19_p11_m0 (SUB3)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_19_p11_m1(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as condition code select
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ COMMON32_GET_CONDITION;
+ if (!check_condition(condition))
+ return m_pc + (size>>0);
+
+ uint32_t result = b - (c << 3);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_19 (SUB3) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2a_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ //COMMON32_GET_areg; // areg is reserved / not used
+
+ uint32_t c;
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ m_regs[breg] = READAUX(c);
+
+
+ if (F)
+ {
+ // no flag changes
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2a_p01(OPS_32)
+{
+ int size = 4;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg is reserved / not used
+
+ uint32_t c;
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ m_regs[breg] = READAUX(c);
+
+
+ if (F)
+ {
+ // no flag changes
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2a_p10(OPS_32)
+{
+ int size = 4;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_s12;
+
+ uint32_t c;
+
+ c = (uint32_t)S;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ m_regs[breg] = READAUX(c);
+
+
+ if (F)
+ {
+ // no flag changes
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2a_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("arcompact_handle04_2a_p11_m0 (LR)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2a_p11_m1(OPS_32)
+{
+ int size = 4;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as condition code select
+
+ uint32_t c;
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ COMMON32_GET_CONDITION;
+ if (!check_condition(condition))
+ return m_pc + (size>>0);
+
+ m_regs[breg] = READAUX(c);
+
+
+ if (F)
+ {
+ // no flag changes
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2b_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ //COMMON32_GET_areg; // areg is reserved / not used
+
+ uint32_t c;
+ uint32_t b;
+
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+ got_limm = 1;
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ WRITEAUX(c,b);
+
+
+ if (F)
+ {
+ // no flag changes
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2b_p01(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg is reserved / not used
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ WRITEAUX(c,b);
+
+
+ if (F)
+ {
+ // no flag changes
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2b_p10(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_s12;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = (uint32_t)S;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ WRITEAUX(c,b);
+
+
+ if (F)
+ {
+ // no flag changes
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2b_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("arcompact_handle04_2b_p11_m0 (SR)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2b_p11_m1(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as condition code select
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ COMMON32_GET_CONDITION;
+ if (!check_condition(condition))
+ return m_pc + (size>>0);
+
+ WRITEAUX(c,b);
+
+
+ if (F)
+ {
+ // no flag changes
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle05_00_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+ got_limm = 1;
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b << (c&0x1f);
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle05_00 (ASL) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle05_00_p01(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b << (c&0x1f);
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle05_00 (ASL) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle05_00_p10(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_s12;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = (uint32_t)S;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b << (c&0x1f);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle05_00 (ASL) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle05_00_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("arcompact_handle05_00_p11_m0 (ASL)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle05_00_p11_m1(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as condition code select
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ COMMON32_GET_CONDITION;
+ if (!check_condition(condition))
+ return m_pc + (size>>0);
+
+ uint32_t result = b << (c&0x1f);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle05_00 (ASL) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle05_01_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+ got_limm = 1;
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b >> (c&0x1f);
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle05_01 (LSR) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle05_01_p01(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ COMMON32_GET_areg;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b >> (c&0x1f);
+ m_regs[areg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle05_01 (LSR) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle05_01_p10(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_s12;
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = (uint32_t)S;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = b >> (c&0x1f);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle05_01 (LSR) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle05_01_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("arcompact_handle05_01_p11_m0 (LSR)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle05_01_p11_m1(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as condition code select
+
+ uint32_t c;
+ uint32_t b;
+
+ /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */
+ if (breg == LIMM_REG)
+ {
+ GET_LIMM_32;
+ size = 8;
+/* got_limm = 1; */
+ b = limm;
+ }
+ else
+ {
+ b = m_regs[breg];
+ }
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ COMMON32_GET_CONDITION;
+ if (!check_condition(condition))
+ return m_pc + (size>>0);
+
+ uint32_t result = b >> (c&0x1f);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle05_01 (LSR) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_02_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ //COMMON32_GET_areg; // areg bits already used as opcode select
+
+ uint32_t c;
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = c >> 1;
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ if (result & 0x80000000) { STATUS32_SET_N; }
+ else { STATUS32_CLEAR_N; }
+ if (result == 0x00000000) { STATUS32_SET_Z; }
+ else { STATUS32_CLEAR_Z; }
+ if (c == 0x00000001) { STATUS32_SET_C; }
+ else { STATUS32_CLEAR_C; }
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_02_p01(OPS_32)
+{
+ int size = 4;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as opcode select
+
+ uint32_t c;
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = c >> 1;
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ if (result & 0x80000000) { STATUS32_SET_N; }
+ else { STATUS32_CLEAR_N; }
+ if (result == 0x00000000) { STATUS32_SET_Z; }
+ else { STATUS32_CLEAR_Z; }
+ if (c == 0x00000001) { STATUS32_SET_C; }
+ else { STATUS32_CLEAR_C; }
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_02_p10(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("illegal arcompact_handle04_2f_02_p10 (ares bits already used as opcode select, can't be used as s12) (LSR1)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_02_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("illegal arcompact_handle04_2f_02_p11_m0 (ares bits already used as opcode select, can't be used as Q condition) (LSR1)\n");
+ return m_pc + (size >> 0);
+}
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_02_p11_m1(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("illegal arcompact_handle04_2f_02_p11_m1 (ares bits already used as opcode select, can't be used as Q condition) (LSR1)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_03_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ //COMMON32_GET_areg; // areg bits already used as opcode select
+
+ uint32_t c;
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ int shift = 1; uint32_t mask = (1 << (shift)) - 1; mask <<= (32-shift); uint32_t result = ((c >> shift) & ~mask) | ((c << (32-shift)) & mask);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ if (result & 0x80000000) { STATUS32_SET_N; }
+ else { STATUS32_CLEAR_N; }
+ if (result == 0x00000000) { STATUS32_SET_Z; }
+ else { STATUS32_CLEAR_Z; }
+ if (c == 0x00000001) { STATUS32_SET_C; }
+ else { STATUS32_CLEAR_C; }
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_03_p01(OPS_32)
+{
+ int size = 4;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as opcode select
+
+ uint32_t c;
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ int shift = 1; uint32_t mask = (1 << (shift)) - 1; mask <<= (32-shift); uint32_t result = ((c >> shift) & ~mask) | ((c << (32-shift)) & mask);
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ if (result & 0x80000000) { STATUS32_SET_N; }
+ else { STATUS32_CLEAR_N; }
+ if (result == 0x00000000) { STATUS32_SET_Z; }
+ else { STATUS32_CLEAR_Z; }
+ if (c == 0x00000001) { STATUS32_SET_C; }
+ else { STATUS32_CLEAR_C; }
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_03_p10(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("illegal arcompact_handle04_2f_03_p10 (ares bits already used as opcode select, can't be used as s12) (ROR)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_03_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("illegal arcompact_handle04_2f_03_p11_m0 (ares bits already used as opcode select, can't be used as Q condition) (ROR)\n");
+ return m_pc + (size >> 0);
+}
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_03_p11_m1(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("illegal arcompact_handle04_2f_03_p11_m1 (ares bits already used as opcode select, can't be used as Q condition) (ROR)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_07_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ //COMMON32_GET_areg; // areg bits already used as opcode select
+
+ uint32_t c;
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = c & 0x000000ff;
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_2f_07 (EXTB) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_07_p01(OPS_32)
+{
+ int size = 4;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as opcode select
+
+ uint32_t c;
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = c & 0x000000ff;
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_2f_07 (EXTB) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_07_p10(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("illegal arcompact_handle04_2f_07_p10 (ares bits already used as opcode select, can't be used as s12) (EXTB)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_07_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("illegal arcompact_handle04_2f_07_p11_m0 (ares bits already used as opcode select, can't be used as Q condition) (EXTB)\n");
+ return m_pc + (size >> 0);
+}
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_07_p11_m1(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("illegal arcompact_handle04_2f_07_p11_m1 (ares bits already used as opcode select, can't be used as Q condition) (EXTB)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_08_p00(OPS_32)
+{
+ int size = 4;
+ uint32_t limm = 0;
+ int got_limm = 0;
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_creg;
+ //COMMON32_GET_areg; // areg bits already used as opcode select
+
+ uint32_t c;
+
+ if (creg == LIMM_REG)
+ {
+ if (!got_limm)
+ {
+ GET_LIMM_32;
+ size = 8;
+ }
+ c = limm;
+ }
+ else
+ {
+ c = m_regs[creg];
+ }
+ /* todo: is the limm, limm syntax valid? (it's pointless.) */
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = c & 0x0000ffff;
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_2f_08 (EXTW) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_08_p01(OPS_32)
+{
+ int size = 4;
+/* int got_limm = 0; */
+
+ COMMON32_GET_breg;
+ COMMON32_GET_F;
+ COMMON32_GET_u6;
+ //COMMON32_GET_areg; // areg bits already used as opcode select
+
+ uint32_t c;
+
+ c = u;
+
+ /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */
+ uint32_t result = c & 0x0000ffff;
+ m_regs[breg] = result;
+
+ if (F)
+ {
+ arcompact_fatal("arcompact_handle04_2f_08 (EXTW) (F set)\n"); // not yet supported
+ }
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_08_p10(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("illegal arcompact_handle04_2f_08_p10 (ares bits already used as opcode select, can't be used as s12) (EXTW)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_08_p11_m0(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("illegal arcompact_handle04_2f_08_p11_m0 (ares bits already used as opcode select, can't be used as Q condition) (EXTW)\n");
+ return m_pc + (size >> 0);
+}
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_2f_08_p11_m1(OPS_32)
+{
+ int size = 4;
+ arcompact_fatal("illegal arcompact_handle04_2f_08_p11_m1 (ares bits already used as opcode select, can't be used as Q condition) (EXTW)\n");
+ return m_pc + (size >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0d_00(OPS_16)
+{
+ int u, breg, creg;
+
+ COMMON16_GET_u3;
+ COMMON16_GET_breg;
+ COMMON16_GET_creg;
+
+ REG_16BIT_RANGE(breg);
+ REG_16BIT_RANGE(creg);
+
+ uint32_t result = m_regs[breg] + u;
+ m_regs[creg] = result;
+
+ return m_pc + (2 >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0d_01(OPS_16)
+{
+ int u, breg, creg;
+
+ COMMON16_GET_u3;
+ COMMON16_GET_breg;
+ COMMON16_GET_creg;
+
+ REG_16BIT_RANGE(breg);
+ REG_16BIT_RANGE(creg);
+
+ uint32_t result = m_regs[breg] - u;
+ m_regs[creg] = result;
+
+ return m_pc + (2 >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0d_02(OPS_16)
+{
+ int u, breg, creg;
+
+ COMMON16_GET_u3;
+ COMMON16_GET_breg;
+ COMMON16_GET_creg;
+
+ REG_16BIT_RANGE(breg);
+ REG_16BIT_RANGE(creg);
+
+ uint32_t result = m_regs[breg] << u;
+ m_regs[creg] = result;
+
+ return m_pc + (2 >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_02(OPS_16)
+{
+ int breg, creg;
+
+ COMMON16_GET_breg;
+ COMMON16_GET_creg;
+
+ REG_16BIT_RANGE(breg);
+ REG_16BIT_RANGE(creg);
+
+ uint32_t result = m_regs[breg] - m_regs[creg];
+ m_regs[breg] = result;
+
+ return m_pc + (2 >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_04(OPS_16)
+{
+ int breg, creg;
+
+ COMMON16_GET_breg;
+ COMMON16_GET_creg;
+
+ REG_16BIT_RANGE(breg);
+ REG_16BIT_RANGE(creg);
+
+ uint32_t result = m_regs[breg] & m_regs[creg];
+ m_regs[breg] = result;
+
+ return m_pc + (2 >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_05(OPS_16)
+{
+ int breg, creg;
+
+ COMMON16_GET_breg;
+ COMMON16_GET_creg;
+
+ REG_16BIT_RANGE(breg);
+ REG_16BIT_RANGE(creg);
+
+ uint32_t result = m_regs[breg] | m_regs[creg];
+ m_regs[breg] = result;
+
+ return m_pc + (2 >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_07(OPS_16)
+{
+ int breg, creg;
+
+ COMMON16_GET_breg;
+ COMMON16_GET_creg;
+
+ REG_16BIT_RANGE(breg);
+ REG_16BIT_RANGE(creg);
+
+ uint32_t result = m_regs[breg] ^ m_regs[creg];
+ m_regs[breg] = result;
+
+ return m_pc + (2 >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_0f(OPS_16)
+{
+ int breg, creg;
+
+ COMMON16_GET_breg;
+ COMMON16_GET_creg;
+
+ REG_16BIT_RANGE(breg);
+ REG_16BIT_RANGE(creg);
+
+ uint32_t result = m_regs[creg] & 0x000000ff;
+ m_regs[breg] = result;
+
+ return m_pc + (2 >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_10(OPS_16)
+{
+ int breg, creg;
+
+ COMMON16_GET_breg;
+ COMMON16_GET_creg;
+
+ REG_16BIT_RANGE(breg);
+ REG_16BIT_RANGE(creg);
+
+ uint32_t result = m_regs[creg] & 0x0000ffff;
+ m_regs[breg] = result;
+
+ return m_pc + (2 >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_13(OPS_16)
+{
+ int breg, creg;
+
+ COMMON16_GET_breg;
+ COMMON16_GET_creg;
+
+ REG_16BIT_RANGE(breg);
+ REG_16BIT_RANGE(creg);
+
+ uint32_t result = 0 - m_regs[creg];
+ m_regs[breg] = result;
+
+ return m_pc + (2 >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_14(OPS_16)
+{
+ int breg, creg;
+
+ COMMON16_GET_breg;
+ COMMON16_GET_creg;
+
+ REG_16BIT_RANGE(breg);
+ REG_16BIT_RANGE(creg);
+
+ uint32_t result = m_regs[breg] + (m_regs[creg] <<1);
+ m_regs[breg] = result;
+
+ return m_pc + (2 >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_15(OPS_16)
+{
+ int breg, creg;
+
+ COMMON16_GET_breg;
+ COMMON16_GET_creg;
+
+ REG_16BIT_RANGE(breg);
+ REG_16BIT_RANGE(creg);
+
+ uint32_t result = m_regs[breg] + (m_regs[creg] <<2);
+ m_regs[breg] = result;
+
+ return m_pc + (2 >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_16(OPS_16)
+{
+ int breg, creg;
+
+ COMMON16_GET_breg;
+ COMMON16_GET_creg;
+
+ REG_16BIT_RANGE(breg);
+ REG_16BIT_RANGE(creg);
+
+ uint32_t result = m_regs[breg] + (m_regs[creg] <<3);
+ m_regs[breg] = result;
+
+ return m_pc + (2 >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_19(OPS_16)
+{
+ int breg, creg;
+
+ COMMON16_GET_breg;
+ COMMON16_GET_creg;
+
+ REG_16BIT_RANGE(breg);
+ REG_16BIT_RANGE(creg);
+
+ uint32_t result = m_regs[breg] >> (m_regs[creg]&0x1f);
+ m_regs[breg] = result;
+
+ return m_pc + (2 >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle0f_1b(OPS_16)
+{
+ int breg, creg;
+
+ COMMON16_GET_breg;
+ COMMON16_GET_creg;
+
+ REG_16BIT_RANGE(breg);
+ REG_16BIT_RANGE(creg);
+
+ uint32_t result = m_regs[creg] << 1;
+ m_regs[breg] = result;
+
+ return m_pc + (2 >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle17_00(OPS_16)
+{
+ int breg, u;
+
+ COMMON16_GET_breg;
+ COMMON16_GET_u5;
+
+ REG_16BIT_RANGE(breg);
+
+ m_regs[breg] = m_regs[breg] << (u&0x1f);
+
+ return m_pc + (2 >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle17_01(OPS_16)
+{
+ int breg, u;
+
+ COMMON16_GET_breg;
+ COMMON16_GET_u5;
+
+ REG_16BIT_RANGE(breg);
+
+ m_regs[breg] = m_regs[breg] >> (u&0x1f);
+
+ return m_pc + (2 >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle17_02(OPS_16)
+{
+ int breg, u;
+
+ COMMON16_GET_breg;
+ COMMON16_GET_u5;
+
+ REG_16BIT_RANGE(breg);
+
+ int32_t temp = (int32_t)m_regs[breg]; m_regs[breg] = temp >> (u&0x1f); // treat it as a signed value, so sign extension occurs during shift
+
+ return m_pc + (2 >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle17_03(OPS_16)
+{
+ int breg, u;
+
+ COMMON16_GET_breg;
+ COMMON16_GET_u5;
+
+ REG_16BIT_RANGE(breg);
+
+ m_regs[breg] = m_regs[breg] - u;
+
+ return m_pc + (2 >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle17_04(OPS_16)
+{
+ int breg, u;
+
+ COMMON16_GET_breg;
+ COMMON16_GET_u5;
+
+ REG_16BIT_RANGE(breg);
+
+ m_regs[breg] = m_regs[breg] | (1 << (u & 0x1f));
+
+ return m_pc + (2 >> 0);
+}
+
+
+ARCOMPACT_RETTYPE arcompact_device::arcompact_handle17_06(OPS_16)
+{
+ int breg, u;
+
+ COMMON16_GET_breg;
+ COMMON16_GET_u5;
+
+ REG_16BIT_RANGE(breg);
+
+ m_regs[breg] = m_regs[breg] | ((1 << (u + 1)) - 1);
+
+ return m_pc + (2 >> 0);
+}
+
+
ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_01(OPS_32)
{
@@ -3701,3 +8132,4 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_07_1c(OPS_16) { arcompac
ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_07_1d(OPS_16) { arcompact_fatal("<illegal 0x18_07_1d> (%04x)", op); return m_pc + (2 >> 0);}
ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_07_1e(OPS_16) { arcompact_fatal("<illegal 0x18_07_1e> (%04x)", op); return m_pc + (2 >> 0);}
ARCOMPACT_RETTYPE arcompact_device::arcompact_handle18_07_1f(OPS_16) { arcompact_fatal("<illegal 0x18_07_1f> (%04x)", op); return m_pc + (2 >> 0);}
+
diff --git a/src/devices/cpu/arcompact/arcompact_make.py b/src/devices/cpu/arcompact/arcompact_make.py
deleted file mode 100644
index 2f1ce7ff4fe..00000000000
--- a/src/devices/cpu/arcompact/arcompact_make.py
+++ /dev/null
@@ -1,435 +0,0 @@
-#!/usr/bin/python
-# license:BSD-3-Clause
-# copyright-holders:David Haywood
-from __future__ import print_function
-import sys
-
-def EmitGroup04_Handle_NZ_Flags(f, funcname, opname):
- print(" if (result & 0x80000000) { STATUS32_SET_N; }", file=f)
- print(" else { STATUS32_CLEAR_N; }", file=f)
- print(" if (result == 0x00000000) { STATUS32_SET_Z; }", file=f)
- print(" else { STATUS32_CLEAR_Z; }", file=f)
-
-def EmitGroup04_Handle_NZC_LSR1_Flags(f, funcname, opname):
- print(" if (result & 0x80000000) { STATUS32_SET_N; }", file=f)
- print(" else { STATUS32_CLEAR_N; }", file=f)
- print(" if (result == 0x00000000) { STATUS32_SET_Z; }", file=f)
- print(" else { STATUS32_CLEAR_Z; }", file=f)
- print(" if (c == 0x00000001) { STATUS32_SET_C; }", file=f)
- print(" else { STATUS32_CLEAR_C; }", file=f)
-
-def EmitGroup04_Handle_NZCV_ADD_Flags(f, funcname, opname):
- print(" if (result & 0x80000000) { STATUS32_SET_N; }", file=f)
- print(" else { STATUS32_CLEAR_N; }", file=f)
- print(" if (result == 0x00000000) { STATUS32_SET_Z; }", file=f)
- print(" else { STATUS32_CLEAR_Z; }", file=f)
- print(" if ((b & 0x80000000) == (c & 0x80000000))", file=f)
- print(" {", file=f)
- print(" if ((result & 0x80000000) != (b & 0x80000000))", file=f)
- print(" {", file=f)
- print(" STATUS32_SET_V;", file=f)
- print(" }", file=f)
- print(" else", file=f)
- print(" {", file=f)
- print(" STATUS32_CLEAR_V;", file=f)
- print(" }", file=f)
- print(" }", file=f)
- print(" if (b < c)", file=f)
- print(" {", file=f)
- print(" STATUS32_SET_C;", file=f)
- print(" }", file=f)
- print(" else", file=f)
- print(" {", file=f)
- print(" STATUS32_CLEAR_C;", file=f)
- print(" }", file=f)
-
-
-def EmitGroup04_no_Flags(f, funcname, opname):
- print(" // no flag changes", file=f)
-
-def EmitGroup04_unsupported_Flags(f, funcname, opname):
- print(" arcompact_fatal(\"arcompact_handle%s (%s) (F set)\\n\"); // not yet supported" % (funcname, opname), file=f)
-
-def EmitGroup04_Flaghandler(f,funcname, opname, flagcondition, flaghandler):
- if flagcondition == -1:
- print(" if (F)", file=f)
- print(" {", file=f)
- flaghandler(f, funcname, opname)
- print(" }", file=f)
- elif flagcondition == 0:
- print(" if (0)", file=f)
- print(" {", file=f)
- flaghandler(f, funcname, opname)
- print(" }", file=f)
- elif flagcondition == 1:
- print(" if (1)", file=f)
- print(" {", file=f)
- flaghandler(f, funcname, opname)
- print(" }", file=f)
-
-def EmitGroup04_u5fragment(f,funcname, opname, opexecute, opwrite, opwrite_alt, ignore_a, breg_is_dst_only, flagcondition, flaghandler):
- print(" int size = 4;", file=f)
-
- if breg_is_dst_only == 0:
- print(" uint32_t limm = 0;", file=f)
-
- print("/* int got_limm = 0; */", file=f)
- print(" ", file=f)
- print(" COMMON32_GET_breg;", file=f)
-
- if flagcondition == -1:
- print(" COMMON32_GET_F;", file=f)
-
- print(" COMMON32_GET_u6;", file=f)
-
- if ignore_a == 0:
- print(" COMMON32_GET_areg;", file=f)
- elif ignore_a == 1:
- print(" //COMMON32_GET_areg; // areg is reserved / not used", file=f)
- elif ignore_a == 2:
- print(" //COMMON32_GET_areg; // areg bits already used as opcode select", file=f)
- elif ignore_a == 3:
- print(" //COMMON32_GET_areg; // areg bits already used as condition code select", file=f)
- print(" ", file=f)
-
- print(" uint32_t c;", file=f)
- if breg_is_dst_only == 0:
- print(" uint32_t b;", file=f)
- print(" ", file=f)
- print(" /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */", file=f)
- print(" if (breg == LIMM_REG)", file=f)
- print(" {", file=f)
- print(" GET_LIMM_32;", file=f)
- print(" size = 8;", file=f)
- print("/* got_limm = 1; */", file=f)
- print(" b = limm;", file=f)
- print(" }", file=f)
- print(" else", file=f)
- print(" {", file=f)
- print(" b = m_regs[breg];", file=f)
- print(" }", file=f)
-
- print(" ", file=f)
- print(" c = u;", file=f)
- print(" ", file=f)
- print(" /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */", file=f)
-
-def EmitGroup04(f,funcname, opname, opexecute, opwrite, opwrite_alt, ignore_a, breg_is_dst_only, flagcondition, flaghandler):
- # the mode 0x00 handler
- print("ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s_p00(OPS_32)" % funcname, file=f)
- print("{", file=f)
- print(" int size = 4;", file=f)
-
- print(" uint32_t limm = 0;", file=f)
-
- print(" int got_limm = 0;", file=f)
- print(" ", file=f)
- print(" COMMON32_GET_breg;", file=f)
-
- if flagcondition == -1:
- print(" COMMON32_GET_F;", file=f)
-
- print(" COMMON32_GET_creg;", file=f)
-
- if ignore_a == 0:
- print(" COMMON32_GET_areg;", file=f)
- elif ignore_a == 1:
- print(" //COMMON32_GET_areg; // areg is reserved / not used", file=f)
- elif ignore_a == 2:
- print(" //COMMON32_GET_areg; // areg bits already used as opcode select", file=f)
-
- print(" ", file=f)
-
- print(" uint32_t c;", file=f)
- if breg_is_dst_only == 0:
- print(" uint32_t b;", file=f)
- print(" ", file=f)
- print(" if (breg == LIMM_REG)", file=f)
- print(" {", file=f)
- print(" GET_LIMM_32;", file=f)
- print(" size = 8;", file=f)
- print(" got_limm = 1;", file=f)
- print(" b = limm;", file=f)
- print(" }", file=f)
- print(" else", file=f)
- print(" {", file=f)
- print(" b = m_regs[breg];", file=f)
- print(" }", file=f)
-
- print(" ", file=f)
- print(" if (creg == LIMM_REG)", file=f)
- print(" {", file=f)
- print(" if (!got_limm)", file=f)
- print(" {", file=f)
- print(" GET_LIMM_32;", file=f)
- print(" size = 8;", file=f)
- print(" }", file=f)
- print(" c = limm;", file=f)
- print(" }", file=f)
- print(" else", file=f)
- print(" {", file=f)
- print(" c = m_regs[creg];", file=f)
- print(" }", file=f)
- print(" /* todo: is the limm, limm syntax valid? (it's pointless.) */", file=f)
- print(" /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */", file=f)
- print(" %s" % opexecute, file=f)
- print(" %s" % opwrite, file=f)
- print(" ", file=f)
- EmitGroup04_Flaghandler(f,funcname,opname,flagcondition,flaghandler)
- print(" return m_pc + (size >> 0);", file=f)
- print("}", file=f)
- print("", file=f)
- print("", file=f)
- # the mode 0x01 handler
- print("ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s_p01(OPS_32)" % funcname, file=f)
- print("{", file=f)
- EmitGroup04_u5fragment(f,funcname, opname, opexecute, opwrite, opwrite_alt, ignore_a, breg_is_dst_only, flagcondition, flaghandler)
- print(" %s" % opexecute, file=f)
- print(" %s" % opwrite, file=f)
- print(" ", file=f)
- EmitGroup04_Flaghandler(f,funcname,opname,flagcondition,flaghandler)
- print(" return m_pc + (size >> 0);", file=f)
- print("}", file=f)
- print("", file=f)
- print("", file=f)
- # the mode 0x10 handler
- print("ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s_p10(OPS_32)" % funcname, file=f)
- if ignore_a == 2:
- print("{", file=f)
- print(" int size = 4;", file=f)
- print(" arcompact_fatal(\"illegal arcompact_handle%s_p10 (ares bits already used as opcode select, can't be used as s12) (%s)\\n\");" % (funcname, opname), file=f)
- print(" return m_pc + (size >> 0);", file=f)
- print("}", file=f)
- else:
- print("{", file=f)
- print(" int size = 4;", file=f)
- if breg_is_dst_only == 0:
- print(" uint32_t limm = 0;", file=f)
-
- print("/* int got_limm = 0; */", file=f)
- print(" ", file=f)
- print(" COMMON32_GET_breg;", file=f)
-
- if flagcondition == -1:
- print(" COMMON32_GET_F;", file=f)
-
- print(" COMMON32_GET_s12;", file=f)
-
- # areg can't be used here, it's used for s12 bits
-
- print(" ", file=f)
- print(" uint32_t c;", file=f)
- if breg_is_dst_only == 0:
- print(" uint32_t b;", file=f)
- print(" ", file=f)
- print(" /* is having b as LIMM valid here? LIMM vs. fixed u6 value makes no sense */", file=f)
- print(" if (breg == LIMM_REG)", file=f)
- print(" {", file=f)
- print(" GET_LIMM_32;", file=f)
- print(" size = 8;", file=f)
- print("/* got_limm = 1; */", file=f)
- print(" b = limm;", file=f)
- print(" }", file=f)
- print(" else", file=f)
- print(" {", file=f)
- print(" b = m_regs[breg];", file=f)
- print(" }", file=f)
-
- print(" ", file=f)
- print(" c = (uint32_t)S;", file=f)
- print(" ", file=f)
- print(" /* todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?) */", file=f)
- print(" %s" % opexecute, file=f)
- print(" %s" % opwrite_alt, file=f)
- print(" ", file=f)
- EmitGroup04_Flaghandler(f,funcname,opname,flagcondition,flaghandler)
- print(" return m_pc + (size >> 0);", file=f)
- print("}", file=f)
- print("", file=f)
- print("", file=f)
- # the mode 0x11 m0 handler
- print("ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s_p11_m0(OPS_32)" % funcname, file=f)
- if ignore_a == 2:
- print("{", file=f)
- print(" int size = 4;", file=f)
- print(" arcompact_fatal(\"illegal arcompact_handle%s_p11_m0 (ares bits already used as opcode select, can't be used as Q condition) (%s)\\n\");" % (funcname, opname), file=f)
- print(" return m_pc + (size >> 0);", file=f)
- print("}", file=f)
- else:
- print("{", file=f)
- print(" int size = 4;", file=f)
- print(" arcompact_fatal(\"arcompact_handle%s_p11_m0 (%s)\\n\");" % (funcname, opname), file=f)
- print(" return m_pc + (size >> 0);", file=f)
- print("}", file=f)
- print("", file=f)
- print("", file=f)
- # the mode 0x11 m1 handler
- print("ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s_p11_m1(OPS_32)" % funcname, file=f)
- if ignore_a == 2:
- print("{", file=f)
- print(" int size = 4;", file=f)
- print(" arcompact_fatal(\"illegal arcompact_handle%s_p11_m1 (ares bits already used as opcode select, can't be used as Q condition) (%s)\\n\");" % (funcname, opname), file=f)
- print(" return m_pc + (size >> 0);", file=f)
- print("}", file=f)
- else:
- print("{", file=f)
- EmitGroup04_u5fragment(f,funcname, opname, opexecute, opwrite, opwrite_alt, 3, breg_is_dst_only, flagcondition, flaghandler)
- print(" COMMON32_GET_CONDITION;", file=f)
- print(" if (!check_condition(condition))", file=f)
- print(" return m_pc + (size>>0);", file=f)
- print("", file=f)
- print(" %s" % opexecute, file=f)
- print(" %s" % opwrite_alt, file=f)
- print(" ", file=f)
- EmitGroup04_Flaghandler(f,funcname,opname,flagcondition,flaghandler)
- print(" return m_pc + (size >> 0);", file=f)
- print("}", file=f)
- print("", file=f)
- print("", file=f)
-
-
-# xxx_S c, b, u3 format opcodes (note c is destination)
-def EmitGroup0d(f,funcname, opname, opexecute, opwrite):
- print("ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s(OPS_16)" % funcname, file=f)
- print("{", file=f)
- print(" int u, breg, creg;", file=f)
- print("", file=f)
- print(" COMMON16_GET_u3;", file=f)
- print(" COMMON16_GET_breg;", file=f)
- print(" COMMON16_GET_creg;", file=f)
- print("", file=f)
- print(" REG_16BIT_RANGE(breg);", file=f)
- print(" REG_16BIT_RANGE(creg);", file=f)
- print("", file=f)
- print(" %s" % opexecute, file=f)
- print(" %s" % opwrite, file=f)
- print("", file=f)
- print(" return m_pc + (2 >> 0);", file=f)
- print("}", file=f)
- print("", file=f)
- print("", file=f)
-
-
-# xxx_S b <- b,c format opcodes
-def EmitGroup0f(f,funcname, opname, opexecute, opwrite):
- print("ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s(OPS_16)"% funcname, file=f)
- print("{", file=f)
- print(" int breg, creg;", file=f)
- print("", file=f)
- print(" COMMON16_GET_breg;", file=f)
- print(" COMMON16_GET_creg;", file=f)
- print("", file=f)
- print(" REG_16BIT_RANGE(breg);", file=f)
- print(" REG_16BIT_RANGE(creg);", file=f)
- print("", file=f)
- print(" %s" % opexecute, file=f)
- print(" %s" % opwrite, file=f)
- print("", file=f)
- print(" return m_pc + (2 >> 0);", file=f)
- print("}", file=f)
- print("", file=f)
- print("", file=f)
-
-
-# xxx_S b, b, u5 format opcodes
-def EmitGroup17(f,funcname, opname, opexecute):
- print("ARCOMPACT_RETTYPE arcompact_device::arcompact_handle%s(OPS_16)" % funcname, file=f)
- print("{", file=f)
- print(" int breg, u;", file=f)
- print(" ", file=f)
- print(" COMMON16_GET_breg;", file=f)
- print(" COMMON16_GET_u5;", file=f)
- print(" ", file=f)
- print(" REG_16BIT_RANGE(breg);", file=f)
- print(" ", file=f)
- print(" %s" % opexecute, file=f)
- print(" ", file=f)
- print(" return m_pc + (2 >> 0);", file=f)
- print("}", file=f)
- print("", file=f)
- print("", file=f)
-
-
-
-try:
- f = open(sys.argv[1], "w")
-except Exception:
- err = sys.exc_info()[1]
- sys.stderr.write("cannot write file %s [%s]\n" % (sys.argv[1], err))
- sys.exit(1)
-
-
-EmitGroup04(f, "04_00", "ADD", "uint32_t result = b + c;", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_Handle_NZCV_ADD_Flags )
-
-EmitGroup04(f, "04_02", "SUB", "uint32_t result = b - c;", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags )
-
-EmitGroup04(f, "04_04", "AND", "uint32_t result = b & c;", "if (areg != LIMM_REG) { m_regs[areg] = result; }", "if (breg != LIMM_REG) { m_regs[breg] = result; }", 0,0, -1, EmitGroup04_Handle_NZ_Flags )
-EmitGroup04(f, "04_05", "OR", "uint32_t result = b | c;", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags )
-EmitGroup04(f, "04_06", "BIC", "uint32_t result = b & (~c);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags )
-EmitGroup04(f, "04_07", "XOR", "uint32_t result = b ^ c;", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags )
-
-EmitGroup04(f, "04_0a", "MOV", "uint32_t result = c;", "m_regs[breg] = result;", "m_regs[breg] = result;", 1,1, -1, EmitGroup04_Handle_NZ_Flags ) # special case, result always goes to breg
-
-EmitGroup04(f, "04_0e", "RSUB", "uint32_t result = c - b;", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags )
-EmitGroup04(f, "04_0f", "BSET", "uint32_t result = b | (1 << (c & 0x1f));", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags )
-
-EmitGroup04(f, "04_13", "BMSK", "uint32_t result = b & ((1<<(c+1))-1);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags )
-
-
-EmitGroup04(f, "04_14", "ADD1", "uint32_t result = b + (c << 1);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags )
-EmitGroup04(f, "04_15", "ADD2", "uint32_t result = b + (c << 2);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags )
-EmitGroup04(f, "04_16", "ADD3", "uint32_t result = b + (c << 3);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags )
-EmitGroup04(f, "04_17", "SUB1", "uint32_t result = b - (c << 1);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags )
-EmitGroup04(f, "04_18", "SUB2", "uint32_t result = b - (c << 2);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags )
-EmitGroup04(f, "04_19", "SUB3", "uint32_t result = b - (c << 3);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags )
-
-EmitGroup04(f, "04_2a", "LR", "m_regs[breg] = READAUX(c);", "", "", 1,1, -1, EmitGroup04_no_Flags ) # this can't be conditional (todo)
-EmitGroup04(f, "04_2b", "SR", "WRITEAUX(c,b);", "", "", 1,0, -1, EmitGroup04_no_Flags ) # this can't be conditional (todo)
-
-
-
-EmitGroup04(f, "05_00", "ASL", "uint32_t result = b << (c&0x1f);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags )
-EmitGroup04(f, "05_01", "LSR", "uint32_t result = b >> (c&0x1f);", "m_regs[areg] = result;", "m_regs[breg] = result;", 0,0, -1, EmitGroup04_unsupported_Flags )
-
-# the 04_2f subgroup uses the same encoding, but the areg is already used as sub-opcode select, so any modes relying on areg bits for other reasons (sign, condition) (modes 10, 11m0, 11m1) are illegal. the destination is also breg not areg
-EmitGroup04(f, "04_2f_02", "LSR1", "uint32_t result = c >> 1;", "m_regs[breg] = result;","", 2,1, -1, EmitGroup04_Handle_NZC_LSR1_Flags ) # no alt handler (invalid path)
-EmitGroup04(f, "04_2f_03", "ROR", "int shift = 1; uint32_t mask = (1 << (shift)) - 1; mask <<= (32-shift); uint32_t result = ((c >> shift) & ~mask) | ((c << (32-shift)) & mask);", "m_regs[breg] = result;","", 2,1, -1, EmitGroup04_Handle_NZC_LSR1_Flags )
-
-
-EmitGroup04(f, "04_2f_07", "EXTB", "uint32_t result = c & 0x000000ff;", "m_regs[breg] = result;","", 2,1, -1, EmitGroup04_unsupported_Flags ) # ^
-EmitGroup04(f, "04_2f_08", "EXTW", "uint32_t result = c & 0x0000ffff;", "m_regs[breg] = result;","", 2,1, -1, EmitGroup04_unsupported_Flags ) # ^
-
-# xxx_S c, b, u3 format opcodes (note c is destination)
-EmitGroup0d(f, "0d_00", "ADD_S", "uint32_t result = m_regs[breg] + u;", "m_regs[creg] = result;" )
-EmitGroup0d(f, "0d_01", "SUB_S", "uint32_t result = m_regs[breg] - u;", "m_regs[creg] = result;" )
-EmitGroup0d(f, "0d_02", "ASL_S", "uint32_t result = m_regs[breg] << u;", "m_regs[creg] = result;" )
-
-# xxx_S b <- b,c format opcodes (or in some cases xxx_S b,c)
-EmitGroup0f(f, "0f_02", "SUB_S", "uint32_t result = m_regs[breg] - m_regs[creg];", "m_regs[breg] = result;" )
-EmitGroup0f(f, "0f_04", "AND_S", "uint32_t result = m_regs[breg] & m_regs[creg];", "m_regs[breg] = result;" )
-EmitGroup0f(f, "0f_05", "OR_S", "uint32_t result = m_regs[breg] | m_regs[creg];", "m_regs[breg] = result;" )
-EmitGroup0f(f, "0f_07", "XOR_S", "uint32_t result = m_regs[breg] ^ m_regs[creg];", "m_regs[breg] = result;" )
-EmitGroup0f(f, "0f_0f", "EXTB_S","uint32_t result = m_regs[creg] & 0x000000ff;", "m_regs[breg] = result;" )
-EmitGroup0f(f, "0f_10", "EXTW_S","uint32_t result = m_regs[creg] & 0x0000ffff;", "m_regs[breg] = result;" )
-EmitGroup0f(f, "0f_13", "NEG_S"," uint32_t result = 0 - m_regs[creg];", "m_regs[breg] = result;" )
-
-EmitGroup0f(f, "0f_14", "ADD1_S"," uint32_t result = m_regs[breg] + (m_regs[creg] <<1);", "m_regs[breg] = result;" )
-EmitGroup0f(f, "0f_15", "ADD2_S"," uint32_t result = m_regs[breg] + (m_regs[creg] <<2);", "m_regs[breg] = result;" )
-EmitGroup0f(f, "0f_16", "ADD3_S"," uint32_t result = m_regs[breg] + (m_regs[creg] <<3);", "m_regs[breg] = result;" )
-
-EmitGroup0f(f, "0f_19", "LSR_S", "uint32_t result = m_regs[breg] >> (m_regs[creg]&0x1f);","m_regs[breg] = result;" )
-EmitGroup0f(f, "0f_1b", "ASL1_S","uint32_t result = m_regs[creg] << 1;", "m_regs[breg] = result;" )
-
-
-# xxx_S b, b, u5 format opcodes
-EmitGroup17(f, "17_00", "ASL_S", "m_regs[breg] = m_regs[breg] << (u&0x1f);" )
-EmitGroup17(f, "17_01", "LSR_S", "m_regs[breg] = m_regs[breg] >> (u&0x1f);" )
-EmitGroup17(f, "17_02", "ASR_S", "int32_t temp = (int32_t)m_regs[breg]; m_regs[breg] = temp >> (u&0x1f); // treat it as a signed value, so sign extension occurs during shift" )
-EmitGroup17(f, "17_03", "SUB_S", "m_regs[breg] = m_regs[breg] - u;" )
-EmitGroup17(f, "17_04", "BSET_S", "m_regs[breg] = m_regs[breg] | (1 << (u & 0x1f));" )
-
-EmitGroup17(f, "17_06", "BMSK_S", "m_regs[breg] = m_regs[breg] | ((1 << (u + 1)) - 1);" )
-
-
-
-