+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
#define S2H r6h
#ifdef __H8300__
+
#define MOVP mov.w /* pointers are 16 bits */
#define ADDP add.w
#define CMPP cmp.w
#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
#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
#define S1P er5
#define S2P er6
+#endif /* !__NORMAL_MODE__ */
+
#define A0E e0
#define A1E e1
#define A2E e2
#define A3E e3
-#endif
+
+#endif /* __H8300S__ */
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 ?
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 ?
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 ?
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
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