]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libgcc/config/xtensa/lib2funcs.S
Update copyright years.
[thirdparty/gcc.git] / libgcc / config / xtensa / lib2funcs.S
index 3ac8c1da2fd89ce943c604aaa1cebe43c187ef13..355a3441c289e3097723f31601f8fa4843001e51 100644 (file)
@@ -1,5 +1,5 @@
 /* Assembly functions for libgcc2.
-   Copyright (C) 2001-2014 Free Software Foundation, Inc.
+   Copyright (C) 2001-2020 Free Software Foundation, Inc.
    Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
 
 This file is part of GCC.
@@ -29,15 +29,36 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    current register window.  This is used to set up the stack so that
    arbitrary frames can be accessed.  */
 
+#if XCHAL_HAVE_WINDOWED && !__XTENSA_CALL0_ABI__
        .align  4
        .global __xtensa_libgcc_window_spill
        .type   __xtensa_libgcc_window_spill,@function
 __xtensa_libgcc_window_spill:
-       entry   sp, 32
-       movi    a2, 0
-       syscall
+       entry   sp, 48
+#if XCHAL_NUM_AREGS > 16
+       call12  1f
+       retw
+       .align  4
+1:
+       .rept   (XCHAL_NUM_AREGS - 24) / 12
+       _entry  sp, 48
+       mov     a12, a0
+       .endr
+       _entry  sp, 16
+#if XCHAL_NUM_AREGS % 12 == 0
+       mov     a4, a4
+#elif XCHAL_NUM_AREGS % 12 == 4
+       mov     a8, a8
+#elif XCHAL_NUM_AREGS % 12 == 8
+       mov     a12, a12
+#endif
+       retw
+#else
+       mov     a8, a8
        retw
+#endif
        .size   __xtensa_libgcc_window_spill, .-__xtensa_libgcc_window_spill
+#endif
 
 
 /* __xtensa_nonlocal_goto: This code does all the hard work of a
@@ -51,6 +72,7 @@ __xtensa_libgcc_window_spill:
   This function never returns to its caller but instead goes directly
   to the address of the specified goto handler.  */
 
+#if XCHAL_HAVE_WINDOWED && !__XTENSA_CALL0_ABI__
        .align  4
        .global __xtensa_nonlocal_goto
        .type   __xtensa_nonlocal_goto,@function
@@ -58,10 +80,7 @@ __xtensa_nonlocal_goto:
        entry   sp, 32
 
        /* Flush registers.  */
-       mov     a5, a2
-       movi    a2, 0
-       syscall
-       mov     a2, a5
+       call8   __xtensa_libgcc_window_spill
 
        /* Because the save area for a0-a3 is stored one frame below
           the one identified by a2, the only way to restore those
@@ -128,6 +147,7 @@ __xtensa_nonlocal_goto:
 
        retw
        .size   __xtensa_nonlocal_goto, .-__xtensa_nonlocal_goto
+#endif
 
 
 /* __xtensa_sync_caches: This function is called after writing a trampoline
@@ -154,7 +174,9 @@ __xtensa_nonlocal_goto:
        .global __xtensa_sync_caches
        .type   __xtensa_sync_caches,@function
 __xtensa_sync_caches:
+#if XCHAL_HAVE_WINDOWED && !__XTENSA_CALL0_ABI__
        entry   sp, 32
+#endif
 #if XCHAL_DCACHE_SIZE > 0
        /* Flush the trampoline from the data cache.  */
        extui   a4, a2, 0, XCHAL_DCACHE_LINEWIDTH
@@ -182,5 +204,9 @@ __xtensa_sync_caches:
        bnez    a4, .Licache_loop
 #endif
        isync
+#if XCHAL_HAVE_WINDOWED && !__XTENSA_CALL0_ABI__
        retw
+#else
+       ret
+#endif
        .size   __xtensa_sync_caches, .-__xtensa_sync_caches