diff options
| author | David Schleef <ds@schleef.org> | 2009-10-18 21:02:30 -0700 |
|---|---|---|
| committer | David Schleef <ds@schleef.org> | 2009-10-18 21:02:30 -0700 |
| commit | 768fc5d07c35a583b3a1657ca617041ee4e2f0ee (patch) | |
| tree | b3a0998d92bd0caab6ecd8404c25b18528cea783 /testsuite | |
| parent | d50ea405460428a13619f9ae6d267d4b5e155fa9 (diff) | |
sse: Special case for constant n programs
Diffstat (limited to 'testsuite')
| -rw-r--r-- | testsuite/exec_opcodes_sys.c | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/testsuite/exec_opcodes_sys.c b/testsuite/exec_opcodes_sys.c index 84b880c..a6cd99f 100644 --- a/testsuite/exec_opcodes_sys.c +++ b/testsuite/exec_opcodes_sys.c @@ -14,6 +14,8 @@ void test_opcode_const (OrcStaticOpcode *opcode); void test_opcode_param (OrcStaticOpcode *opcode); void test_opcode_inplace (OrcStaticOpcode *opcode); void test_opcode_src_2d (OrcStaticOpcode *opcode); +void test_opcode_src_const_n (OrcStaticOpcode *opcode); +void test_opcode_src_const_n_2d (OrcStaticOpcode *opcode); int main (int argc, char *argv[]) @@ -66,6 +68,22 @@ main (int argc, char *argv[]) opcode_set->opcodes[i].src_size[1]); test_opcode_src_2d (opcode_set->opcodes + i); } + for(i=0;i<opcode_set->n_opcodes;i++){ + printf("/* %s src const n %d,%d,%d */\n", + opcode_set->opcodes[i].name, + opcode_set->opcodes[i].dest_size[0], + opcode_set->opcodes[i].src_size[0], + opcode_set->opcodes[i].src_size[1]); + test_opcode_src_const_n (opcode_set->opcodes + i); + } + for(i=0;i<opcode_set->n_opcodes;i++){ + printf("/* %s src const n 2d %d,%d,%d */\n", + opcode_set->opcodes[i].name, + opcode_set->opcodes[i].dest_size[0], + opcode_set->opcodes[i].src_size[0], + opcode_set->opcodes[i].src_size[1]); + test_opcode_src_const_n_2d (opcode_set->opcodes + i); + } if (error) return 1; return 0; @@ -207,3 +225,60 @@ test_opcode_src_2d (OrcStaticOpcode *opcode) orc_program_free (p); } +void +test_opcode_src_const_n (OrcStaticOpcode *opcode) +{ + OrcProgram *p; + char s[40]; + int ret; + + if (opcode->src_size[1] == 0) { + p = orc_program_new_ds (opcode->dest_size[0], opcode->src_size[0]); + } else { + p = orc_program_new_dss (opcode->dest_size[0], opcode->src_size[0], + opcode->src_size[1]); + } + + sprintf(s, "test_s_%s", opcode->name); + orc_program_set_name (p, s); + orc_program_set_constant_n (p, 8); + + orc_program_append_str (p, opcode->name, "d1", "s1", "s2"); + + ret = orc_test_compare_output (p); + if (!ret) { + error = TRUE; + } + + orc_program_free (p); +} + +void +test_opcode_src_const_n_2d (OrcStaticOpcode *opcode) +{ + OrcProgram *p; + char s[40]; + int ret; + + if (opcode->src_size[1] == 0) { + p = orc_program_new_ds (opcode->dest_size[0], opcode->src_size[0]); + } else { + p = orc_program_new_dss (opcode->dest_size[0], opcode->src_size[0], + opcode->src_size[1]); + } + + sprintf(s, "test_s_%s", opcode->name); + orc_program_set_name (p, s); + orc_program_set_2d (p); + orc_program_set_constant_n (p, 8); + + orc_program_append_str (p, opcode->name, "d1", "s1", "s2"); + + ret = orc_test_compare_output (p); + if (!ret) { + error = TRUE; + } + + orc_program_free (p); +} + |
