• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisiona7c587f5cd390f92970c2c4b5a538ac27ea3f119 (tree)
Time2022-09-27 19:01:23
AuthorSergey Matyukevich <sergey.matyukevich@syno...>
CommiterWaldemar Brodkorb

Log Message

arc: add asm macros

Add a header file with assembler macros to be able to handle in one
place the differences between ARCv2 and ARCv3 ISAs. It is a preparatory
step before the introduction of support for ARCv3 CPUs.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich@synopsys.com>
Signed-off-by: Pavel Kozlov <pavel.kozlov@synopsys.com>

Change Summary

Incremental Difference

--- a/ldso/ldso/arc/resolve.S
+++ b/ldso/ldso/arc/resolve.S
@@ -4,6 +4,7 @@
44 * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
55 */
66
7+#include <asm.h>
78 #include <sysdep.h>
89 #include <sys/syscall.h>
910
@@ -12,30 +13,30 @@
1213 ; r10-r12 are already clobbered by PLTn, PLT0 thus neednot be saved
1314
1415 .macro SAVE_CALLER_SAVED
15- push_s r0
16- push_s r1
17- push_s r2
18- push_s r3
19- st.a r4, [sp, -4]
20- st.a r5, [sp, -4]
21- st.a r6, [sp, -4]
22- st.a r7, [sp, -4]
23- st.a r8, [sp, -4]
24- st.a r9, [sp, -4]
25- push_s blink
16+ PUSHR_S r0
17+ PUSHR_S r1
18+ PUSHR_S r2
19+ PUSHR_S r3
20+ PUSHR r4
21+ PUSHR r5
22+ PUSHR r6
23+ PUSHR r7
24+ PUSHR r8
25+ PUSHR r9
26+ PUSHR_S blink
2627 .endm
2728
2829 .macro RESTORE_CALLER_SAVED_BUT_R0
29- ld.ab blink,[sp, 4]
30- ld.ab r9, [sp, 4]
31- ld.ab r8, [sp, 4]
32- ld.ab r7, [sp, 4]
33- ld.ab r6, [sp, 4]
34- ld.ab r5, [sp, 4]
35- ld.ab r4, [sp, 4]
36- pop_s r3
37- pop_s r2
38- pop_s r1
30+ POPR blink
31+ POPR r9
32+ POPR r8
33+ POPR r7
34+ POPR r6
35+ POPR r5
36+ POPR r4
37+ POPR_S r3
38+ POPR_S r2
39+ POPR_S r1
3940 .endm
4041
4142 ; Upon entry, PLTn, which led us here, sets up the following regs
@@ -53,5 +54,5 @@ ENTRY(_dl_linux_resolve)
5354
5455 RESTORE_CALLER_SAVED_BUT_R0
5556 j_s.d [r0] ; r0 has resolved function addr
56- pop_s r0 ; restore first arg to resolved call
57+ POPR_S r0 ; restore first arg to resolved call
5758 END(_dl_linux_resolve)
--- /dev/null
+++ b/libc/sysdeps/linux/arc/asm.h
@@ -0,0 +1,28 @@
1+/*
2+ * Copyright (C) 2022, Synopsys, Inc. (www.synopsys.com)
3+ *
4+ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
5+ */
6+
7+#ifndef _ARC_ASM_H
8+#define _ARC_ASM_H
9+
10+
11+.macro PUSHR reg
12+ push \reg
13+.endm
14+
15+.macro PUSHR_S reg
16+ push_s \reg
17+.endm
18+
19+.macro POPR reg
20+ pop \reg
21+.endm
22+
23+.macro POPR_S reg
24+ pop_s \reg
25+.endm
26+
27+
28+#endif /* _ARC_ASM_H */