xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/testsuite/gdb.arch/s390-vregs.S (revision 6881a4007f077b54e5f51159c52b9b25f57deb0d)
1/* Copyright 2015-2023 Free Software Foundation, Inc.
2
3   This file is part of GDB.
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	.text
19
20	/* 'check_vx': Yield SIGILL unless vector support is
21	available.  Have a "pit stop" breakpoint here.  */
22
23	.align	8
24	.type	check_vx, @function
25check_vx:
26	.cfi_startproc
27	/* vlr  %v0,%v0 */
28	.byte 0xe7,0x00,0x00,0x00,0x00,0x56
29	br	%r14
30	.cfi_endproc
31	.size	check_vx, .-check_vx
32
33
34	/* 'store_vrs': Store vector registers in save_area.  */
35
36	.align 8
37	.type	store_vrs, @function
38store_vrs:
39	.cfi_startproc
40	larl	%r1,save_area
41	/* vstm %v0,%v15,0(%r1) */
42	.byte 0xe7,0x0f,0x10,0x00,0x00,0x3e
43	/* vstm %v16,%v31,256(%r1) */
44	.byte 0xe7,0x0f,0x11,0x00,0x0c,0x3e
45	br	%r14
46	.cfi_endproc
47	.size	store_vrs, .-store_vrs
48
49
50	/* 'change_vrs': Manipulate vector registers according to a
51	simple algorithm.  */
52
53	.align 8
54	.type	change_vrs, @function
55change_vrs:
56	.cfi_startproc
57	lghi	%r1,16
58	lghi	%r3,0xff
591:	.insn	ril,0xc60000000000,%r3,2f /* exrl */
60	.insn	ril,0xc60000000000,%r3,1f /* exrl */
61	aghi	%r3,-0x11
62	brctg	%r1,1b
63	br	%r14
64	.cfi_endproc
65	/* vmlf %v0,%v0,%v0 */
661:	.byte	0xe7,0x00,0x00,0x00,0x20,0xa2
67	/* vmlf %v16,%v16,%v0 */
682:	.byte	0xe7,0x00,0x00,0x00,0x2c,0xa2
69
70
71	/* 'main': Perform actions according to test case logic.
72	Invoke check_vx whenever a pit stop is required.  */
73
74	.section	.text.startup,"ax",@progbits
75	.align	8
76.globl main
77	.type	main, @function
78main:
79	.cfi_startproc
80	stmg	%r14,%r15,112(%r15)
81	aghi	%r15,-160
82	bras	%r14,check_vx
83	bras	%r14,store_vrs
84	bras	%r14,check_vx
85	bras	%r14,change_vrs
86	bras	%r14,check_vx
87	lmg	%r14,%r15,272(%r15)
88	lghi	%r2,0
89	br	%r14
90	.cfi_endproc
91	.size	main, .-main
92
93	.local	save_area
94	.comm	save_area,512,16
95
96	.section	.note.GNU-stack,"",@progbits
97