summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
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; \
})