xref: /linux/arch/riscv/kernel/tests/module_test/test_sub64.S (revision 0ea5c948cb64bab5bc7a5516774eb8536f05aa0d)
1*af71bc19SCharlie Jenkins/* SPDX-License-Identifier: GPL-2.0 */
2*af71bc19SCharlie Jenkins/*
3*af71bc19SCharlie Jenkins * Copyright (C) 2023 Rivos Inc.
4*af71bc19SCharlie Jenkins */
5*af71bc19SCharlie Jenkins
6*af71bc19SCharlie Jenkins.text
7*af71bc19SCharlie Jenkins.global test_sub64
8*af71bc19SCharlie Jenkinstest_sub64:
9*af71bc19SCharlie Jenkins#ifdef CONFIG_32BIT
10*af71bc19SCharlie Jenkins	lw	a0, sub64
11*af71bc19SCharlie Jenkins#else
12*af71bc19SCharlie Jenkins	ld	a0, sub64
13*af71bc19SCharlie Jenkins#endif
14*af71bc19SCharlie Jenkins	addi	a0, a0, -32
15*af71bc19SCharlie Jenkins	ret
16*af71bc19SCharlie Jenkinsfirst:
17*af71bc19SCharlie Jenkins	.space 32
18*af71bc19SCharlie Jenkinssecond:
19*af71bc19SCharlie Jenkins
20*af71bc19SCharlie Jenkins.data
21*af71bc19SCharlie Jenkinssub64:
22*af71bc19SCharlie Jenkins	.reloc		sub64, R_RISCV_ADD64, second
23*af71bc19SCharlie Jenkins	.reloc		sub64, R_RISCV_SUB64, first
24*af71bc19SCharlie Jenkins	.word		0
25*af71bc19SCharlie Jenkins	.word		0
26