diff options
author | David Schleef <ds@wendolyne.(none)> | 2010-08-25 03:26:58 -0700 |
---|---|---|
committer | David Schleef <ds@wendolyne.(none)> | 2010-08-25 03:26:58 -0700 |
commit | 5e6f2927d0d431eb8da31542b69b3c86fcc07272 (patch) | |
tree | aa13ba3913cc351321126f294bc58d389d616a53 /orc-test | |
parent | cbc9fdceb694c01fb5653352c74b3a4b5cc47e53 (diff) |
test: Add denormal array pattern
Diffstat (limited to 'orc-test')
-rw-r--r-- | orc-test/orcarray.c | 14 | ||||
-rw-r--r-- | orc-test/orcarray.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/orc-test/orcarray.c b/orc-test/orcarray.c index c84a2da..23c8bfa 100644 --- a/orc-test/orcarray.c +++ b/orc-test/orcarray.c @@ -150,6 +150,20 @@ orc_array_set_pattern_2 (OrcArray *array, OrcRandomContext *context, } } break; + case ORC_PATTERN_FLOAT_DENORMAL: + { + if (array->element_size != 4) return; + for(j=0;j<array->m;j++){ + orc_union32 *data; + + data = ORC_PTR_OFFSET(array->data, array->stride * j); + + for(i=0;i<array->n;i++){ + data[i].i = orc_random (context); + data[i].i &= ~0x7f800000; + } + } + } break; default: break; diff --git a/orc-test/orcarray.h b/orc-test/orcarray.h index 46281e9..eb57c57 100644 --- a/orc-test/orcarray.h +++ b/orc-test/orcarray.h @@ -24,6 +24,7 @@ enum { ORC_PATTERN_RANDOM = 0, ORC_PATTERN_FLOAT_SMALL, ORC_PATTERN_FLOAT_SPECIAL, + ORC_PATTERN_FLOAT_DENORMAL }; OrcArray *orc_array_new (int n, int m, int element_size, int misalignment); |