Initialize the register dumping machinery while testing assembler code.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 4 Nov 2019 12:04:16 +0000 (12:04 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 9 May 2020 19:57:33 +0000 (20:57 +0100)
math/mpmont-exp.c
math/mpmont.c
math/mpx-mul4-test.c
math/mpx.c
symm/chacha.c
symm/gcm.c
symm/rijndael.c
symm/rijndael192.c
symm/rijndael256.c
symm/salsa20.c

index 6b5c8c4..ff15b2d 100644 (file)
@@ -93,6 +93,10 @@ mp *mpmont_exp(const mpmont *mm, mp *d, mp *a, mp *e)
 
 #ifdef TEST_RIG
 
+#ifdef ENABLE_ASM_DEBUG
+#  include "regdump.h"
+#endif
+
 static int texp(dstr *v)
 {
   mp *m = *(mp **)v[0].buf;
@@ -136,6 +140,9 @@ static test_chunk tests[] = {
 int main(int argc, char *argv[])
 {
   sub_init();
+#ifdef ENABLE_ASM_DEBUG
+  regdump_init();
+#endif
   test_run(argc, argv, tests, SRCDIR "/t/mpmont");
   return (0);
 }
index 094ac40..cc5ffaf 100644 (file)
@@ -444,6 +444,10 @@ mp *mpmont_mul(const mpmont *mm, mp *d, mp *a, mp *b)
 
 #ifdef TEST_RIG
 
+#ifdef ENABLE_ASM_DEBUG
+#  include "regdump.h"
+#endif
+
 static int tcreate(dstr *v)
 {
   mp *m = *(mp **)v[0].buf;
@@ -558,6 +562,9 @@ static test_chunk tests[] = {
 int main(int argc, char *argv[])
 {
   sub_init();
+#ifdef ENABLE_ASM_DEBUG
+  regdump_init();
+#endif
   test_run(argc, argv, tests, SRCDIR "/t/mpmont");
   return (0);
 }
index 30e7691..85a1532 100644 (file)
 
 #include "config.h"
 
+#ifdef ENABLE_ASM_DEBUG
+#  include "regdump.h"
+#endif
+
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -319,6 +323,9 @@ static test_chunk tests[] = {
 int main(int argc, char *argv[])
 {
   sub_init();
+#ifdef ENABLE_ASM_DEBUG
+  regdump_init();
+#endif
   if (!cpu_features_p())
     { fprintf(stderr, "required cpu feature not available\n"); exit(77); }
   test_run(argc, argv, tests, SRCDIR "/t/mpx-mul4");
index 07a6c20..f761003 100644 (file)
@@ -1278,6 +1278,10 @@ mpw mpx_udivn(mpw *qv, mpw *qvl, const mpw *rv, const mpw *rvl, mpw d)
 #include <mLib/quis.h>
 #include <mLib/testrig.h>
 
+#ifdef ENABLE_ASM_DEBUG
+#  include "regdump.h"
+#endif
+
 #include "mpscan.h"
 
 #define ALLOC(v, vl, sz) do {                                          \
@@ -1709,6 +1713,9 @@ static test_chunk defs[] = {
 
 int main(int argc, char *argv[])
 {
+#ifdef ENABLE_ASM_DEBUG
+  regdump_init();
+#endif
   test_run(argc, argv, defs, SRCDIR"/t/mpx");
   return (0);
 }
index b06deae..8cc16b8 100644 (file)
@@ -853,6 +853,10 @@ CHACHA_VARS(DEFXGRAND)
 #include <mLib/quis.h>
 #include <mLib/testrig.h>
 
+#ifdef ENABLE_ASM_DEBUG
+#  include "regdump.h"
+#endif
+
 #define DEFVCORE(r)                                                    \
   static int v_core_##r(dstr *v)                                       \
   {                                                                    \
@@ -987,6 +991,9 @@ CHACHA_VARS(DEFXTAB)
 
 int main(int argc, char *argv[])
 {
+#ifdef ENABLE_ASM_DEBUG
+  regdump_init();
+#endif
   test_run(argc, argv, defs, SRCDIR"/t/chacha");
   return (0);
 }
index 9571894..b438415 100644 (file)
@@ -782,6 +782,10 @@ void gcm_concat(const gcm_params *p, uint32 *z, const uint32 *x,
 #include <mLib/quis.h>
 #include <mLib/testrig.h>
 
+#ifdef ENABLE_ASM_DEBUG
+#  include "regdump.h"
+#endif
+
 static void report_failure(const char *test, unsigned nbits,
                           const char *ref, dstr v[], dstr *d)
 {
@@ -874,6 +878,9 @@ GCM_WIDTHS(TEST)
 int main(int argc,  char *argv[])
 {
   ego(argv[0]);
+#ifdef ENABLE_ASM_DEBUG
+  regdump_init();
+#endif
   test_run(argc, argv, defs, SRCDIR"/t/gcm");
   return (0);
 }
index 7db9e01..597ae98 100644 (file)
 
 #include <mLib/bits.h>
 
+#if defined(TEST_RIG) && defined(ENABLE_ASM_DEBUG)
+#  include "regdump.h"
+#  define BLKC_TESTHOOK do { regdump_init(); } while (0)
+#endif
+
 #include "blkc.h"
 #include "dispatch.h"
 #include "gcipher.h"
index 424f8f9..46562fe 100644 (file)
 
 #include <mLib/bits.h>
 
+#if defined(TEST_RIG) && defined(ENABLE_ASM_DEBUG)
+#  include "regdump.h"
+#  define BLKC_TESTHOOK do { regdump_init(); } while (0)
+#endif
+
 #include "blkc.h"
 #include "gcipher.h"
 #include "rijndael.h"
index 9fb7298..4030ab2 100644 (file)
 
 #include <mLib/bits.h>
 
+#if defined(TEST_RIG) && defined(ENABLE_ASM_DEBUG)
+#  include "regdump.h"
+#  define BLKC_TESTHOOK do { regdump_init(); } while (0)
+#endif
+
 #include "blkc.h"
 #include "gcipher.h"
 #include "rijndael.h"
index 7806e6c..f0fe3d7 100644 (file)
@@ -875,6 +875,10 @@ SALSA20_VARS(DEFXGRAND)
 #include <mLib/quis.h>
 #include <mLib/testrig.h>
 
+#ifdef ENABLE_ASM_DEBUG
+#  include "regdump.h"
+#endif
+
 static const int perm[] = {
    0, 13, 10,  7,
    4,  1, 14, 11,
@@ -1017,6 +1021,9 @@ SALSA20_VARS(DEFXTAB)
 
 int main(int argc, char *argv[])
 {
+#ifdef ENABLE_ASM_DEBUG
+  regdump_init();
+#endif
   test_run(argc, argv, defs, SRCDIR"/t/salsa20");
   return (0);
 }