xref: /linux/arch/riscv/kernel/tests/module_test/test_set16.S (revision a06c3fad49a50d5d5eb078f93e70f4d3eca5d5a5)
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (C) 2023 Rivos Inc.
4 */
5
6.text
7.global test_set16
8test_set16:
9	lw	a0, set16
10	la	t0, set16
11#ifdef CONFIG_32BIT
12	slli	t0, t0, 16
13	srli	t0, t0, 16
14#else
15	slli	t0, t0, 48
16	srli	t0, t0, 48
17#endif
18	sub	a0, a0, t0
19	ret
20.data
21set16:
22	.reloc set16, R_RISCV_SET16, set16
23	.word 0
24