|
-
-
-
-
-
- .global memset
- .text
- .syntax unified
- .thumb
- .align 2
-
-
- .type memset, %function
- .thumb_func
- memset:
- //FUNCTION(memset)
- // save the original pointer
- push { r0, lr }
-
-
- cbz r2, .L_done
-
-
-
- cmp r2,
- blt .L_bytewise
-
-
- and r3, r0,
- cbz r3, .L_prepare_dwordwise
- rsb r3,
- subs r2, r3
-
- .L_bytewise_align:
-
- subs r3, r3,
- strb r1, [r0],
- bgt .L_bytewise_align
-
- .L_prepare_dwordwise:
-
- uxtb r1, r1
- orr r1, r1, r1, lsl
- orr r1, r1, r1, lsl
- mov r12, r1
-
-
- lsrs r3, r2,
-
- .L_dwordwise:
-
-
- subs r3, r3,
- strd r1, r12, [r0],
- bgt .L_dwordwise
-
-
- ands r2,
- beq .L_done
-
- .L_bytewise:
-
- subs r2, r2,
- strb r1, [r0],
- bgt .L_bytewise
-
- .L_done:
-
- pop { r0, pc }
-
-
|