Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/arm fix conditional instructions to conform to ...



details:   https://anonhg.NetBSD.org/src/rev/cf290752257f
branches:  trunk
changeset: 789208:cf290752257f
user:      matt <matt%NetBSD.org@localhost>
date:      Sun Aug 11 02:53:18 2013 +0000

description:
fix conditional instructions to conform to unified syntax
use push/pop
use RET/RETc

diffstat:

 sys/arch/arm/arm/bcopyinout_xscale.S |  198 ++++++++++++++++++----------------
 1 files changed, 102 insertions(+), 96 deletions(-)

diffs (truncated from 534 to 300 lines):

diff -r 77637d0d109b -r cf290752257f sys/arch/arm/arm/bcopyinout_xscale.S
--- a/sys/arch/arm/arm/bcopyinout_xscale.S      Sun Aug 11 02:45:56 2013 +0000
+++ b/sys/arch/arm/arm/bcopyinout_xscale.S      Sun Aug 11 02:53:18 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcopyinout_xscale.S,v 1.7 2009/01/18 01:19:32 bjh21 Exp $      */
+/*     $NetBSD: bcopyinout_xscale.S,v 1.8 2013/08/11 02:53:18 matt Exp $       */
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -35,7 +35,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-RCSID("$NetBSD: bcopyinout_xscale.S,v 1.7 2009/01/18 01:19:32 bjh21 Exp $")    
+RCSID("$NetBSD: bcopyinout_xscale.S,v 1.8 2013/08/11 02:53:18 matt Exp $")     
 
        .text
        .align  0
@@ -50,9 +50,9 @@
 ENTRY(copyin)
        cmp     r2, #0x00
        movle   r0, #0x00
-       movle   pc, lr                  /* Bail early if length is <= 0 */
+       RETc(le)                        /* Bail early if length is <= 0 */
 
-       stmfd   sp!, {r10-r11, lr}
+       push    {r10-r11, lr}
 
        GET_CURPCB(r10)
 
@@ -63,14 +63,16 @@
        bl      .Lcopyin_guts
        str     r11, [r10, #PCB_ONFAULT]
        mov     r0, #0x00
-       ldmfd   sp!, {r10-r11, pc}
+       pop     {r10-r11, lr}
+       RET
 
 .Lcopyin_fault:
        str     r11, [r10, #PCB_ONFAULT]
        cmp     r3, #0x00
-       ldmgtfd sp!, {r4-r7}            /* r3 > 0 Restore r4-r7 */
-       ldmltfd sp!, {r4-r9}            /* r3 < 0 Restore r4-r9 */
-       ldmfd   sp!, {r10-r11, pc}
+       popgt   {r4-r7}         /* r3 > 0 Restore r4-r7 */
+       poplt   {r4-r9}         /* r3 < 0 Restore r4-r9 */
+       pop     {r10-r11, lr}
+       RET
 
 .Lcopyin_guts:
        pld     [r0]
@@ -91,7 +93,7 @@
        ldrbt   ip, [r0], #0x01
        strb    ip, [r1], #0x01
        cmp     r2, #0x00               /* All done? */
-       moveq   pc, lr
+       RETc(eq)
 
        /* Destination buffer is now word aligned */
 .Lcopyin_wordaligned:
@@ -102,8 +104,8 @@
 
        /* Quad-align the destination buffer */
        tst     r1, #0x07               /* Already quad aligned? */
-       ldrnet  ip, [r0], #0x04
-       stmfd   sp!, {r4-r9}            /* Free up some registers */
+       ldrtne  ip, [r0], #0x04
+       push    {r4-r9}         /* Free up some registers */
        mov     r3, #-1                 /* Signal restore r4-r9 */
        tst     r1, #0x07               /* XXX: bug work-around */
        subne   r2, r2, #0x04
@@ -172,8 +174,8 @@
 
 .Lcopyin_w_lessthan128:
        adds    r2, r2, #0x80           /* Adjust for extra sub */
-       ldmeqfd sp!, {r4-r9}
-       moveq   pc, lr                  /* Return now if done */
+       popeq   {r4-r9}
+       RETc(eq)                        /* Return now if done */
        subs    r2, r2, #0x20
        blt     .Lcopyin_w_lessthan32
 
@@ -197,8 +199,8 @@
 
 .Lcopyin_w_lessthan32:
        adds    r2, r2, #0x20           /* Adjust for extra sub */
-       ldmeqfd sp!, {r4-r9}
-       moveq   pc, lr                  /* Return now if done */
+       popeq   {r4-r9}
+       RETc(eq)                        /* Return now if done */
 
        and     r4, r2, #0x18
        rsb     r5, r4, #0x18
@@ -225,24 +227,24 @@
        strd    r4, [r1], #0x08
 
        /* Less than 8 bytes remaining */
-       ldmfd   sp!, {r4-r9}
-       moveq   pc, lr                  /* Return now if done */
+       pop     {r4-r9}
+       RETc(eq)                        /* Return now if done */
        mov     r3, #0x00
 
 .Lcopyin_w_less_than8:
        subs    r2, r2, #0x04
-       ldrget  ip, [r0], #0x04
+       ldrtge  ip, [r0], #0x04
        strge   ip, [r1], #0x04
-       moveq   pc, lr                  /* Return now if done */
+       RETc(eq)                        /* Return now if done */
        addlt   r2, r2, #0x04
        ldrbt   ip, [r0], #0x01
        cmp     r2, #0x02
-       ldrgebt r2, [r0], #0x01
+       ldrbtge r2, [r0], #0x01
        strb    ip, [r1], #0x01
-       ldrgtbt ip, [r0]
-       strgeb  r2, [r1], #0x01
-       strgtb  ip, [r1]
-       mov     pc, lr
+       ldrbtgt ip, [r0]
+       strbge  r2, [r1], #0x01
+       strbgt  ip, [r1]
+       RETc(eq)        
 
 /*
  * At this point, it has not been possible to word align both buffers.
@@ -250,7 +252,7 @@
  * (r0) is not.
  */
 .Lcopyin_bad_align:
-       stmfd   sp!, {r4-r7}
+       push    {r4-r7}
        mov     r3, #0x01
        bic     r0, r0, #0x03
        cmp     ip, #2
@@ -296,8 +298,8 @@
        bge     .Lcopyin_bad1_loop16
 
        adds    r2, r2, #0x10         
-       ldmeqfd sp!, {r4-r7}
-       moveq   pc, lr                  /* Return now if done */
+       popeq   {r4-r7}
+       RETc(eq)                        /* Return now if done */
        subs    r2, r2, #0x04
        sublt   r0, r0, #0x03
        blt     .Lcopyin_l4
@@ -357,8 +359,8 @@
        bge     .Lcopyin_bad2_loop16
 
        adds    r2, r2, #0x10         
-       ldmeqfd sp!, {r4-r7}
-       moveq   pc, lr                  /* Return now if done */
+       popeq   {r4-r7}
+       RETc(eq)                        /* Return now if done */
        subs    r2, r2, #0x04
        sublt   r0, r0, #0x02
        blt     .Lcopyin_l4
@@ -418,8 +420,8 @@
        bge     .Lcopyin_bad3_loop16
 
        adds    r2, r2, #0x10         
-       ldmeqfd sp!, {r4-r7}
-       moveq   pc, lr                  /* Return now if done */
+       popeq   {r4-r7}
+       RETc(eq)                        /* Return now if done */
        subs    r2, r2, #0x04
        sublt   r0, r0, #0x01
        blt     .Lcopyin_l4
@@ -442,10 +444,10 @@
        sub     r0, r0, #0x01
 
 .Lcopyin_l4:
-       ldmfd   sp!, {r4-r7}
+       pop     {r4-r7}
        mov     r3, #0x00
        adds    r2, r2, #0x04
-       moveq   pc, lr
+       RETc(eq)        
 .Lcopyin_l4_2:
        rsbs    r2, r2, #0x03
        addne   pc, pc, r2, lsl #3
@@ -456,7 +458,7 @@
        strb    ip, [r1], #0x01
        ldrbt   ip, [r0]
        strb    ip, [r1]
-       mov     pc, lr
+       RET
 
 
 /*
@@ -469,9 +471,9 @@
 ENTRY(copyout)
        cmp     r2, #0x00
        movle   r0, #0x00
-       movle   pc, lr                  /* Bail early if length is <= 0 */
+       RETc(le)                        /* Bail early if length is <= 0 */
 
-       stmfd   sp!, {r10-r11, lr}
+       push    {r10-r11, lr}
 
        GET_CURPCB(r10)
 
@@ -482,14 +484,16 @@
        bl      .Lcopyout_guts
        str     r11, [r10, #PCB_ONFAULT]
        mov     r0, #0x00
-       ldmfd   sp!, {r10-r11, pc}
+       pop     {r10-r11, lr}
+       RET
 
 .Lcopyout_fault:
        str     r11, [r10, #PCB_ONFAULT]
        cmp     r3, #0x00
-       ldmgtfd sp!, {r4-r7}            /* r3 > 0 Restore r4-r7 */
-       ldmltfd sp!, {r4-r9}            /* r3 < 0 Restore r4-r9 */
-       ldmfd   sp!, {r10-r11, pc}
+       popgt   {r4-r7}         /* r3 > 0 Restore r4-r7 */
+       poplt   {r4-r9}         /* r3 < 0 Restore r4-r9 */
+       pop     {r10-r11, lr}
+       RET
 
 .Lcopyout_guts:
        pld     [r0]
@@ -510,7 +514,7 @@
        ldrb    ip, [r0], #0x01
        strbt   ip, [r1], #0x01
        cmp     r2, #0x00               /* All done? */
-       moveq   pc, lr
+       RETc(eq)
 
        /* Destination buffer is now word aligned */
 .Lcopyout_wordaligned:
@@ -522,11 +526,11 @@
        /* Quad-align the destination buffer */
        tst     r1, #0x07               /* Already quad aligned? */
        ldrne   ip, [r0], #0x04
-       stmfd   sp!, {r4-r9}            /* Free up some registers */
+       push    {r4-r9}         /* Free up some registers */
        mov     r3, #-1                 /* Signal restore r4-r9 */
        tst     r1, #0x07               /* XXX: bug work-around */
        subne   r2, r2, #0x04
-       strnet  ip, [r1], #0x04
+       strtne  ip, [r1], #0x04
 
        /* Destination buffer quad aligned, source is word aligned */
        subs    r2, r2, #0x80
@@ -607,8 +611,8 @@
 
 .Lcopyout_w_lessthan128:
        adds    r2, r2, #0x80           /* Adjust for extra sub */
-       ldmeqfd sp!, {r4-r9}
-       moveq   pc, lr                  /* Return now if done */
+       popeq   {r4-r9}
+       RETc(eq)                        /* Return now if done */
        subs    r2, r2, #0x20
        blt     .Lcopyout_w_lessthan32
 
@@ -636,8 +640,8 @@
 
 .Lcopyout_w_lessthan32:
        adds    r2, r2, #0x20           /* Adjust for extra sub */
-       ldmeqfd sp!, {r4-r9}
-       moveq   pc, lr                  /* Return now if done */
+       popeq   {r4-r9}
+       RETc(eq)                        /* Return now if done */
 
        and     r4, r2, #0x18
        rsb     r5, r4, #0x18
@@ -664,24 +668,24 @@
        strt    r5, [r1], #0x04
 
        /* Less than 8 bytes remaining */
-       ldmfd   sp!, {r4-r9}
-       moveq   pc, lr                  /* Return now if done */
+       pop     {r4-r9}
+       RETc(eq)                        /* Return now if done */
        mov     r3, #0x00
 
 .Lcopyout_w_less_than8:
        subs    r2, r2, #0x04
        ldrge   ip, [r0], #0x04
-       strget  ip, [r1], #0x04
-       moveq   pc, lr                  /* Return now if done */
+       strtge  ip, [r1], #0x04
+       RETc(eq)                        /* Return now if done */
        addlt   r2, r2, #0x04
        ldrb    ip, [r0], #0x01
        cmp     r2, #0x02
-       ldrgeb  r2, [r0], #0x01
+       ldrbge  r2, [r0], #0x01
        strbt   ip, [r1], #0x01
-       ldrgtb  ip, [r0]
-       strgebt r2, [r1], #0x01
-       strgtbt ip, [r1]
-       mov     pc, lr
+       ldrbgt  ip, [r0]
+       strbtge r2, [r1], #0x01
+       strbtgt ip, [r1]
+       RET



Home | Main Index | Thread Index | Old Index