xref: /illumos-gate/usr/src/test/util-tests/tests/dis/risc-v-c/tst.int.s (revision 66582b606a8194f7f3ba5b3a3a6dca5b0d346361)
1/*
2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
5 * 1.0 of the CDDL.
6 *
7 * A full copy of the text of the CDDL should have accompanied this
8 * source.  A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
10 */
11
12/*
13 * Copyright 2018, Joyent, Inc.
14 */
15
16/*
17 * Test common compact integer instructions
18 */
19
20.text
21.align 16
22.globl libdis_test
23.type libdis_test, @function
24libdis_test:
25	c.li	ra, 0x15
26	c.li	s11, -0x13
27	c.lui	s1, 0x2
28	c.lui	s1, 0x13
29
30	c.addi	s1, 0x1f
31	c.addi	s1, 0x3
32	c.addi	s1, -0x20
33
34	c.addi16sp	sp, 0x30
35	c.addi16sp	sp, -0x40
36	c.addi4spn	a1, sp, 0x10
37	c.addi4spn	a1, sp, 0x2c
38
39	c.slli	s10, 0x5
40	c.slli	t4, 0x13
41	c.slli	s0, 0x2
42	c.srli	a2, 0x4
43	c.srli	s1, 0x15
44	c.srai	a3, 0x4
45	c.srai	a5, 0x19
46	c.andi	a4, 0x3
47	c.andi	a3, -0x7
48	c.mv	s1, a4
49	c.mv	a0, a5
50	c.add	a1, a3
51	c.add	a2, a2
52	c.and	a0, a1
53	c.or	a1, a2
54	c.xor	a2, a3
55	c.sub	a3, a4
56
57	c.nop
58	c.ebreak
59.size libdis_test, [.-libdis_test]
60