Commit | Line | Data |
---|---|---|
515aff23 LM |
1 | /* This testcase is part of GDB, the GNU debugger. |
2 | ||
e2882c85 | 3 | Copyright 2015-2018 Free Software Foundation, Inc. |
515aff23 LM |
4 | |
5 | This program is free software; you can redistribute it and/or modify | |
6 | it under the terms of the GNU General Public License as published by | |
7 | the Free Software Foundation; either version 3 of the License, or | |
8 | (at your option) any later version. | |
9 | ||
10 | This program is distributed in the hope that it will be useful, | |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | GNU General Public License for more details. | |
14 | ||
15 | You should have received a copy of the GNU General Public License | |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
17 | ||
18 | static void | |
19 | ext_reg_load (void) | |
20 | { | |
21 | char in[8]; | |
22 | ||
23 | asm ("vldr d0, [%0]" : : "r" (in)); | |
24 | asm ("vldr s3, [%0]" : : "r" (in)); | |
25 | ||
26 | asm ("vldm %0, {d3-d4}" : : "r" (in)); | |
27 | asm ("vldm %0, {s9-s11}" : : "r" (in)); | |
28 | } | |
29 | ||
30 | static void | |
31 | ext_reg_mov (void) | |
32 | { | |
33 | int i, j; | |
34 | double d; | |
35 | ||
36 | i = 1; | |
37 | j = 2; | |
38 | ||
39 | asm ("vmov s4, s5, %0, %1" : "=r" (i), "=r" (j): ); | |
40 | asm ("vmov s7, s8, %0, %1" : "=r" (i), "=r" (j): ); | |
41 | asm ("vmov %0, %1, s10, s11" : : "r" (i), "r" (j)); | |
42 | asm ("vmov %0, %1, s1, s2" : : "r" (i), "r" (j)); | |
43 | ||
44 | asm ("vmov %P2, %0, %1" : "=r" (i), "=r" (j): "w" (d)); | |
45 | asm ("vmov %1, %2, %P0" : "=w" (d) : "r" (i), "r" (j)); | |
46 | } | |
47 | ||
48 | static void | |
49 | ext_reg_push_pop (void) | |
50 | { | |
51 | double d; | |
52 | ||
53 | asm ("vpush {%P0}" : : "w" (d)); | |
54 | asm ("vpop {%P0}" : : "w" (d)); | |
55 | } | |
56 | ||
57 | /* Initialize arch-specific bits. */ | |
58 | ||
59 | static void initialize (void) | |
60 | { | |
61 | /* ARM doesn't currently use this function. */ | |
62 | } | |
63 | ||
64 | /* Functions testing instruction decodings. GDB will test all of these. */ | |
65 | static testcase_ftype testcases[] = | |
66 | { | |
67 | ext_reg_load, | |
68 | ext_reg_mov, | |
69 | ext_reg_push_pop, | |
70 | }; |