summaryrefslogtreecommitdiff
path: root/tests/checkasm/checkasm.h
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2015-12-30 23:46:06 +0200
committerMartin Storsjö <martin@martin.st>2016-01-07 09:33:24 +0200
commit26ec75aec3576daea691dee53a78ec67c0dc4040 (patch)
tree85455196d7b386dc38ef3542173c48af3ae4b3b5 /tests/checkasm/checkasm.h
parentfa463aa83a4920b0eed47ad1f79775dfc53d21ec (diff)
checkasm: Check register clobbering on arm
Use two separate functions, depending on whether VFP/NEON is available. This is set to require armv5te - it uses blx, which is only available since armv5t, but we don't have a separate configure item for that. (It also uses ldrd, which requires armv5te, but this could be avoided if necessary.) Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'tests/checkasm/checkasm.h')
-rw-r--r--tests/checkasm/checkasm.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h
index 0bc66b91fa..2486cb5b5b 100644
--- a/tests/checkasm/checkasm.h
+++ b/tests/checkasm/checkasm.h
@@ -116,6 +116,15 @@ void checkasm_stack_clobber(uint64_t clobber, ...);
(void *)checkasm_checked_call;
#define call_new(...) checked_call(func_new, __VA_ARGS__)
#endif
+#elif ARCH_ARM && HAVE_ARMV5TE_EXTERNAL
+/* Use a dummy argument, to offset the real parameters by 2, not only 1.
+ * This makes sure that potential 8-byte-alignment of parameters is kept the same
+ * even when the extra parameters have been removed. */
+void checkasm_checked_call_vfp(void *func, int dummy, ...);
+void checkasm_checked_call_novfp(void *func, int dummy, ...);
+extern void (*checkasm_checked_call)(void *func, int dummy, ...);
+#define declare_new(ret, ...) ret (*checked_call)(void *, int dummy, __VA_ARGS__) = (void *)checkasm_checked_call;
+#define call_new(...) checked_call(func_new, 0, __VA_ARGS__)
#else
#define declare_new(ret, ...)
#define declare_new_emms(cpu_flags, ret, ...)
@@ -123,6 +132,10 @@ void checkasm_stack_clobber(uint64_t clobber, ...);
#define call_new(...) ((func_type *)func_new)(__VA_ARGS__)
#endif
+#ifndef declare_new_emms
+#define declare_new_emms(cpu_flags, ret, ...) declare_new(ret, __VA_ARGS__)
+#endif
+
/* Benchmark the function */
#ifdef AV_READ_TIME
#define bench_new(...)\