2003-11-20 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
* libc/machine/h8300/defines.h : Correct pointer register defines for normal mode. * libc/machine/h8300/memcpy.S : Use add/sub instead of adds/subs for normal mode. * libc/machine/h8300/reg_memcpy.S : Likewise. * libc/machine/h8300/reg_memset.S : Likewise. * libc/machine/h8300/strcmp.S : Likewise.
This commit is contained in:
parent
94cacaf60b
commit
7343eefbde
|
@ -1,3 +1,13 @@
|
|||
2003-11-20 Dhananjay Deshpande <dhananjayd@kpitcummins.com>
|
||||
|
||||
* libc/machine/h8300/defines.h : Correct pointer register defines
|
||||
for normal mode.
|
||||
* libc/machine/h8300/memcpy.S : Use add/sub instead of adds/subs
|
||||
for normal mode.
|
||||
* libc/machine/h8300/reg_memcpy.S : Likewise.
|
||||
* libc/machine/h8300/reg_memset.S : Likewise.
|
||||
* libc/machine/h8300/strcmp.S : Likewise.
|
||||
|
||||
2003-11-19 Nicholas Wourms <nwourms@netscape.net>
|
||||
|
||||
* configure.host: Enable positional arguments for printf
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#define S2H r6h
|
||||
|
||||
#ifdef __H8300__
|
||||
|
||||
#define MOVP mov.w /* pointers are 16 bits */
|
||||
#define ADDP add.w
|
||||
#define CMPP cmp.w
|
||||
|
@ -41,9 +42,29 @@
|
|||
#define S0P r4
|
||||
#define S1P r5
|
||||
#define S2P r6
|
||||
#endif
|
||||
|
||||
#endif /* __H8300__ */
|
||||
|
||||
#ifdef __H8300H__
|
||||
|
||||
#ifdef __NORMAL_MODE__
|
||||
|
||||
#define MOVP mov.w /* pointers are 16 bits */
|
||||
#define ADDP add.w
|
||||
#define CMPP cmp.w
|
||||
#define PUSHP push
|
||||
#define POPP pop
|
||||
|
||||
#define A0P r0
|
||||
#define A1P r1
|
||||
#define A2P r2
|
||||
#define A3P r3
|
||||
#define S0P r4
|
||||
#define S1P r5
|
||||
#define S2P r6
|
||||
|
||||
#else /* !__NORMAL_MODE__ */
|
||||
|
||||
#define MOVP mov.l /* pointers are 32 bits */
|
||||
#define ADDP add.l
|
||||
#define CMPP cmp.l
|
||||
|
@ -58,13 +79,35 @@
|
|||
#define S1P er5
|
||||
#define S2P er6
|
||||
|
||||
#endif /* !__NORMAL_MODE__ */
|
||||
|
||||
#define A0E e0
|
||||
#define A1E e1
|
||||
#define A2E e2
|
||||
#define A3E e3
|
||||
#endif
|
||||
|
||||
#endif /* __H8300H__ */
|
||||
|
||||
#ifdef __H8300S__
|
||||
|
||||
#ifdef __NORMAL_MODE__
|
||||
|
||||
#define MOVP mov.w /* pointers are 16 bits */
|
||||
#define ADDP add.w
|
||||
#define CMPP cmp.w
|
||||
#define PUSHP push
|
||||
#define POPP pop
|
||||
|
||||
#define A0P r0
|
||||
#define A1P r1
|
||||
#define A2P r2
|
||||
#define A3P r3
|
||||
#define S0P r4
|
||||
#define S1P r5
|
||||
#define S2P r6
|
||||
|
||||
#else /* !__NORMAL_MODE__ */
|
||||
|
||||
#define MOVP mov.l /* pointers are 32 bits */
|
||||
#define ADDP add.l
|
||||
#define CMPP cmp.l
|
||||
|
@ -79,8 +122,11 @@
|
|||
#define S1P er5
|
||||
#define S2P er6
|
||||
|
||||
#endif /* !__NORMAL_MODE__ */
|
||||
|
||||
#define A0E e0
|
||||
#define A1E e1
|
||||
#define A2E e2
|
||||
#define A3E e3
|
||||
#endif
|
||||
|
||||
#endif /* __H8300S__ */
|
||||
|
|
|
@ -23,7 +23,11 @@ _memcpy:
|
|||
bne byteloop
|
||||
|
||||
wordloop:
|
||||
#ifdef __NORMAL_MODE__
|
||||
sub #2,A1P
|
||||
#else
|
||||
subs #2,A1P ; point to word
|
||||
#endif
|
||||
mov.w @A1P,A2 ; get word
|
||||
mov.w A2,@-A0P ; save word
|
||||
CMPP A0P,A3P ; at the front again ?
|
||||
|
@ -31,7 +35,11 @@ wordloop:
|
|||
rts
|
||||
|
||||
byteloop:
|
||||
#ifdef __NORMAL_MODE__
|
||||
sub #1,A1P
|
||||
#else
|
||||
subs #1,A1P ; point to byte
|
||||
#endif
|
||||
mov.b @A1P,A2L ; get byte
|
||||
mov.b A2L,@-A0P ; save byte
|
||||
CMPP A0P,A3P ; at the front again ?
|
||||
|
|
|
@ -14,8 +14,12 @@ ___reg_memcpy:
|
|||
CMPP A0P,A3P ; see if anything to do
|
||||
beq quit
|
||||
|
||||
|
||||
loop: subs #1,A1P ; point to byte
|
||||
loop:
|
||||
#ifdef __NORMAL_MODE__
|
||||
sub #1,A1P ; point to byte
|
||||
#else
|
||||
subs #1,A1P ; point to byte
|
||||
#endif
|
||||
mov.b @A1P,A2L ; get byte
|
||||
mov.b A2L,@-A0P ; save byte
|
||||
CMPP A0P,A3P ; at the front again ?
|
||||
|
|
|
@ -14,8 +14,13 @@ ___reg_memset:
|
|||
|
||||
memloop:
|
||||
mov.b A1L,@A0P
|
||||
#ifdef __NORMAL_MODE__
|
||||
add #1,A0P
|
||||
sub #1,A2P
|
||||
#else
|
||||
adds #1,A0P
|
||||
subs #1,A2P
|
||||
#endif
|
||||
MOVP A2P,A2P
|
||||
bne memloop
|
||||
|
||||
|
|
|
@ -14,7 +14,11 @@ _strcmp:
|
|||
mov.b @A3P+,A0L
|
||||
cmp.b A0L,A1L
|
||||
beq .L5
|
||||
#ifdef __NORMAL_MODE__
|
||||
sub #1,A3P
|
||||
#else
|
||||
subs #1,A3P
|
||||
#endif
|
||||
.L3:
|
||||
mov.b @(-1,A2P),A0L
|
||||
mov.b @A3P,A1L
|
||||
|
|
Loading…
Reference in New Issue