From c8f2dce026b5cf160eda33f4aa44e723bfa33d43 Mon Sep 17 00:00:00 2001 From: David Harris Date: Tue, 8 Mar 2022 23:18:18 +0000 Subject: [PATCH] fma16_testgen.c test cases --- pipelined/src/fma/fma16_testgen.c | 93 ++++++++++++++++++++++++++++++- 1 file changed, 90 insertions(+), 3 deletions(-) diff --git a/pipelined/src/fma/fma16_testgen.c b/pipelined/src/fma/fma16_testgen.c index b294552e..a5f3e083 100644 --- a/pipelined/src/fma/fma16_testgen.c +++ b/pipelined/src/fma/fma16_testgen.c @@ -11,6 +11,7 @@ typedef union sp { // lists of tests, terminated with 0x8000 uint16_t easyExponents[] = {15, 0x8000}; uint16_t medExponents[] = {1, 14, 15, 16, 20, 30, 0x8000}; +uint16_t allExponents[] = {1, 15, 16, 30, 31, 0x8000}; uint16_t easyFracts[] = {0, 0x200, 0x8000}; // 1.0 and 1.1 uint16_t medFracts[] = {0, 0x200, 0x001, 0x3FF, 0x8000}; uint16_t zeros[] = {0x0000, 0x8000}; @@ -107,8 +108,8 @@ void genMulTests(uint16_t *e, uint16_t *f, int sgn, char *testName, char *desc, fclose(fptr); } -void genAddTests(uint16_t *e, uint16_t *f, int sgn, char *testName, char *desc) { - int i, j, numCases; +void genAddTests(uint16_t *e, uint16_t *f, int sgn, char *testName, char *desc, int zeroAllowed, int infAllowed, int nanAllowed) { + int i, j, k, numCases; float16_t x, y, z; float16_t cases[100000]; FILE *fptr; @@ -122,7 +123,72 @@ void genAddTests(uint16_t *e, uint16_t *f, int sgn, char *testName, char *desc) x.v = cases[i].v; for (j=0; j