[newlib-cygwin] arc: Have nops in _exit_halt only for ARCompact

Corinna Vinschen corinna@sourceware.org
Wed May 25 10:16:00 GMT 2016


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=d1dcdb8886370ea1fc348417c0d934e0f4243beb

commit d1dcdb8886370ea1fc348417c0d934e0f4243beb
Author: Anton Kolesov <Anton.Kolesov@synopsys.com>
Date:   Fri May 13 18:21:08 2016 +0300

    arc: Have nops in _exit_halt only for ARCompact
    
    ARCompact processors (ARC 600 and ARC 700) require three "nop"s after the
    "flag 1" instruction. Later ARC processors do not have this requirement, so
    it is possible to reduce size of "_exit_halt" for them.
    
    libgloss/
    2016-05-24  Anton Kolesov  <Anton.Kolesov@synopsys.com>
    
    	* arc/crt0.S (_exit_halt): Insert nops only for ARCompact.

Diff:
---
 libgloss/arc/crt0.S | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/libgloss/arc/crt0.S b/libgloss/arc/crt0.S
index 1d966c2..7db07ff 100644
--- a/libgloss/arc/crt0.S
+++ b/libgloss/arc/crt0.S
@@ -207,15 +207,18 @@ __start:
 	; r0 contains exit code
 	j	@exit
 
-	.section .text._exit_halt,"ax",@progbits
-	.global	 _exit_halt
-	.type	 _exit_halt, @function
+.section .text._exit_halt,"ax",@progbits
+.global	 _exit_halt
+.type	 _exit_halt, @function
 
 _exit_halt:
 	; r0 contains exit code
-	flag	0x01
+	flag	1
+#if defined (__ARC600__) || defined (__ARC700__)
+	; ARCompact requires 3 nops after flag 1
 	nop
-	nop			; ARCompact requires 3 nops after flag 1
 	nop
-	b	@_exit_halt
 	nop
+#endif
+	b	@_exit_halt
+.balign 4



More information about the Newlib-cvs mailing list