Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 1 | /* |
| 2 | |
| 3 | Copyright (c) 2009, 2010, 2011 STMicroelectronics |
| 4 | Written by Christophe Lyon |
| 5 | |
| 6 | Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | of this software and associated documentation files (the "Software"), to deal |
| 8 | in the Software without restriction, including without limitation the rights |
| 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 | copies of the Software, and to permit persons to whom the Software is |
| 11 | furnished to do so, subject to the following conditions: |
| 12 | |
| 13 | The above copyright notice and this permission notice shall be included in |
| 14 | all copies or substantial portions of the Software. |
| 15 | |
| 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 22 | THE SOFTWARE. |
| 23 | |
| 24 | */ |
| 25 | |
| 26 | #define INSN_NAME vabs |
| 27 | #define TEST_MSG "VABS/VABSQ" |
| 28 | |
| 29 | /* Extra tests for functions requiring floating-point types */ |
| 30 | void exec_vabs_f32(void); |
| 31 | #define EXTRA_TESTS exec_vabs_f32 |
| 32 | |
| 33 | #include "ref_v_unary_op.c" |
| 34 | |
| 35 | void exec_vabs_f32(void) |
| 36 | { |
| 37 | int i; |
| 38 | |
| 39 | DECL_VARIABLE(vector, float, 32, 2); |
| 40 | DECL_VARIABLE(vector, float, 32, 4); |
| 41 | |
| 42 | DECL_VARIABLE(vector_res, float, 32, 2); |
| 43 | DECL_VARIABLE(vector_res, float, 32, 4); |
| 44 | |
Christophe Lyon | f205367 | 2014-12-16 10:26:00 +0100 | [diff] [blame] | 45 | VDUP(vector, , float, f, 32, 2, -2.3f); |
| 46 | VDUP(vector, q, float, f, 32, 4, 3.4f); |
Christophe Lyon | 073831a | 2011-01-24 17:37:40 +0100 | [diff] [blame] | 47 | |
| 48 | TEST_UNARY_OP(INSN_NAME, , float, f, 32, 2); |
| 49 | TEST_UNARY_OP(INSN_NAME, q, float, f, 32, 4); |
| 50 | |
| 51 | fprintf(ref_file, "\nfloat32:\n"); |
| 52 | DUMP_FP(TEST_MSG, float, 32, 2, PRIx32); |
| 53 | DUMP_FP(TEST_MSG, float, 32, 4, PRIx32); |
| 54 | } |