xref: /illumos-gate/usr/src/test/util-tests/tests/dis/risc-v/64.rv64i.s (revision e121b61f5e8ffbeb2f6b373c967c80351333ee21)
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 our disassembly of the RV64I instructions. Instructions are ordered per the
18 * ISA manual.
19 */
20
21.text
22.align 16
23.globl libdis_test
24.type libdis_test, @function
25libdis_test:
26	lwu	s7, 0x7ff(s1)
27	lwu	s6, (s1)
28	lwu	s5, -0x800(s1)
29	ld	s4, 0x7ff(s1)
30	ld	s3, (s1)
31	ld	s2, -0x800(s1)
32	sd	t0, 0x7ff(t1)
33	sd	t1, (t2)
34	sd	t2, -0x800(t3)
35	slli	s0, s1, 2
36	slli	s0, s1, 63
37	srli	s0, s1, 2
38	srli	s0, s1, 63
39	srai	s0, s1, 2
40	srai	s0, s1, 63
41	addiw	ra, t0, 0x4
42	addiw	ra, t0, -0x4
43	slliw	t4, t5, 0x12
44	srliw	t4, t5, 0x13
45	sraiw	t4, t5, 0x14
46	addw	s0, s1, s2
47	subw	s1, s2, s3
48	sllw	s3, s4, s5
49	srlw	s3, s4, s5
50	sraw	s3, s4, s5
51
52.size libdis_test, [.-libdis_test]
53