4 ! by Toshiyasu Morita (tm@netcom.com)
6 ! SH5 code by J"orn Rennecke (joern.rennecke@superh.com)
7 ! Copyright 2002 SuperH Ltd.
19 addi r5, -1, r20 // calculate end address.
22 bne/u r25, r20, tr0 // multiquad
24 ! This sequence could clobber volatile objects that are in the same
25 ! quadword as a very short char array.
45 endset: blink tr2, r63
48 mperm.w r3, r63, r3 // Fill pattern now in every byte of r3
57 mperm.w r3, r63, r3 // Fill pattern now in every byte of r3
62 beqi/u r24, 8, tr0 // lastquad
64 addi r20, -7*8, r8 // loop end address; This might overflow, so we need
65 // to use a different test before we start the loop
66 bgeu/u r24, r9, tr1// loop
70 beqi/u r24, 1, tr0 // lastquad
73 beqi/u r24, 2, tr0 // lastquad
87 bgeu/l r8, r25, tr1 // loop
96 #else /* ! SHMEDIA, i.e. SH1 .. SH4 / SHcompact */
97 ! Entry: r4: destination pointer
101 ! Exit: r0-r3: trashed
104 ! This assumes that the first four bytes of the address space (0..3) are
105 ! reserved - usually by the linker script. Otherwise, we would had to check
106 ! for the case of objects of the size 12..15 at address 0..3 .
120 mov #12,r0 ! Check for small number of bytes
123 SL(bt, L_store_byte_loop_check0, add DST,CNT)
125 tst #3,r0 ! Align destination
126 SL(bt, L_dup_bytes, extu.b r5,r5)
135 swap.b VAL,TMP ! Duplicate bytes across longword
144 mov.l VAL,@r0 ! Store double longs to memory
147 SL(bf, L_store_long_loop, add #8,r0)
151 L_store_byte_loop_check0:
156 mov.b VAL,@r0 ! Store bytes to memory
164 #endif /* ! SHMEDIA */