OSDN Git Service

PR target/24837
[pf3gnuchains/gcc-fork.git] / gcc / config / xtensa / lib2funcs.S
index f607e01..c858456 100644 (file)
@@ -25,51 +25,24 @@ for more details.
 
 You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING.  If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.  */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA.  */
 
-#include "xtensa/xtensa-config.h"
+#include "xtensa-config.h"
 
-/* __xtensa_libgcc_window_spill: This function uses a series of nested
-   calls to flush out all but the current register window.  This is
-   used to set up the stack so that arbitrary frames can be accessed.
-   The functions used for the nested calls are also reused by the
-   nonlocal goto function below. */
+/* __xtensa_libgcc_window_spill: This function flushes out all but the
+   current register window.  This is used to set up the stack so that
+   arbitrary frames can be accessed.  */
 
-        .align  4
-        .global __xtensa_libgcc_window_spill
-        .type   __xtensa_libgcc_window_spill,@function
+       .align  4
+       .global __xtensa_libgcc_window_spill
+       .type   __xtensa_libgcc_window_spill,@function
 __xtensa_libgcc_window_spill:
-       entry   sp, 48
-       call4   .L__wdwspill_assist52   // called with call8, only need a call4
-       retw
-        .size   __xtensa_libgcc_window_spill,.-__xtensa_libgcc_window_spill
-
-        .align  4
-.L__wdwspill_assist56:
-       entry   sp, 16
-       call4   .L__wdwspill_assist52
-       retw
-        .align  4
-.L__wdwspill_assist52:
-       entry   sp, 48
-       call12  .L__wdwspill_assist40
-       retw
-        .align  4
-.L__wdwspill_assist40:
-       entry   sp, 48
-       call12  .L__wdwspill_assist28
-       retw
-        .align  4
-.L__wdwspill_assist28:
-       entry   sp, 48
-       call12  .L__wdwspill_assist16
-       retw
-        .align  4
-.L__wdwspill_assist16:
-       entry   sp, 16
-       movi    a15, 0
+       entry   sp, 32
+       movi    a2, 0
+       syscall
        retw
+       .size   __xtensa_libgcc_window_spill,.-__xtensa_libgcc_window_spill
 
 
 /* __xtensa_nonlocal_goto: This code does all the hard work of a
@@ -90,7 +63,10 @@ __xtensa_nonlocal_goto:
        entry   sp, 32
 
        /* flush registers */
-       call8   .L__wdwspill_assist56
+       mov     a5, a2
+       movi    a2, 0
+       syscall
+       mov     a2, a5
 
        /* Because the save area for a0-a3 is stored one frame below
           the one identified by a2, the only way to restore those
@@ -115,7 +91,7 @@ __xtensa_nonlocal_goto:
           function.  This can be extracted from the high bits of the
           return address, initially in a0.  As the unwinding
           proceeds, the window size is taken from the value of a0
-          saved _two_ frames below the current frame. */
+          saved _two_ frames below the current frame.  */
 
        addi    a5, sp, -16             # a5 = prev - save area
        l32i    a6, a5, 4
@@ -136,7 +112,7 @@ __xtensa_nonlocal_goto:
           current sp so they will be reloaded when the return from this
           function underflows.  We don't have to worry about exceptions
           while updating the current save area, because the windows have
-          already been flushed. */
+          already been flushed.  */
 
        addi    a4, sp, -16             # a4 = save area of this function
        l32i    a6, a5, 0
@@ -149,7 +125,7 @@ __xtensa_nonlocal_goto:
        s32i    a7, a4, 12
        
        /* Set return address to goto handler.  Use the window size bits
-          from the return address two frames below the target. */
+          from the return address two frames below the target.  */
        extui   a8, a8, 30, 2           # get window size from return addr.
        slli    a3, a3, 2               # get goto handler addr. << 2
        ssai    2
@@ -173,9 +149,9 @@ __xtensa_nonlocal_goto:
    At least one IHI instruction is needed for each i-cache line which may
    be touched by the trampoline.  An ISYNC instruction is also needed to
    make sure that the modified instructions are loaded into the instruction
-   fetch buffer. */
-       
-#define TRAMPOLINE_SIZE 49
+   fetch buffer.  */
+
+#define TRAMPOLINE_SIZE 60
 
        .text
        .align  4
@@ -183,7 +159,7 @@ __xtensa_nonlocal_goto:
        .type   __xtensa_sync_caches,@function
 __xtensa_sync_caches:
        entry   sp, 32
-#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_IS_WRITEBACK
+#if XCHAL_DCACHE_SIZE > 0
        # Flush the trampoline from the data cache
        extui   a4, a2, 0, XCHAL_DCACHE_LINEWIDTH
        addi    a4, a4, TRAMPOLINE_SIZE