summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-06-19 17:23:48 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-06-19 17:23:48 (GMT)
commit84f86b7860014dad1a80aabd4e0bf7504710bfe8 (patch)
treedd1bf99ed3b5313eaf57dc17a57ffcab51aec2eb /plugins
parent31a927d786385a3c79468bfd3af351dc776a908d (diff)
Built ARMv7 dynamic vector tables with the right number of registers.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/arm/v7/helpers.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/plugins/arm/v7/helpers.h b/plugins/arm/v7/helpers.h
index 4f9a8f9..08b14e2 100644
--- a/plugins/arm/v7/helpers.h
+++ b/plugins/arm/v7/helpers.h
@@ -211,17 +211,28 @@
})
-#define DynamicVectorTable(target, count, first, inc) \
+#define DynamicVectorTable(target, count, first, rel) \
({ \
GArchOperand *__result; \
size_t __i; \
GArchRegister *__reg; \
- __result = g_armv7_reglist_operand_new(0); \
- for (__i = 0; __i < count; __i += inc) \
+ if (count % rel != 0) \
+ __result = NULL; \
+ else \
{ \
- __reg = g_armv7_simd_register_new(target, first + __i); \
- g_armv7_reglist_add_register(G_ARMV7_REGLIST_OPERAND(__result), \
- G_ARMV7_REGISTER(__reg)); \
+ __result = g_armv7_reglist_operand_new(0); \
+ for (__i = 0; __i < (count / rel); __i++) \
+ { \
+ __reg = g_armv7_simd_register_new(target, first + __i); \
+ if (__reg == NULL) \
+ { \
+ g_object_unref(G_OBJECT(__result)); \
+ __result = NULL; \
+ break; \
+ } \
+ g_armv7_reglist_add_register(G_ARMV7_REGLIST_OPERAND(__result), \
+ G_ARMV7_REGISTER(__reg)); \
+ } \
} \
__result; \
})