Commit fce8b7e1 authored by Davi Arnaut's avatar Davi Arnaut

WL#5486: Remove code for unsupported platforms

Remove ASM for MC68000 and Vax.
parent 9c841535
...@@ -23,10 +23,6 @@ ...@@ -23,10 +23,6 @@
bfill(dst, len, fill) moves "len" fill characters to "dst". bfill(dst, len, fill) moves "len" fill characters to "dst".
Thus to set a buffer to 80 spaces, do bfill(buff, 80, ' '). Thus to set a buffer to 80 spaces, do bfill(buff, 80, ' ').
Note: the "b" routines are there to exploit certain VAX order codes,
but the MOVC5 instruction will only move 65535 characters. The asm
code is presented for your interest and amusement.
*/ */
#include <my_global.h> #include <my_global.h>
...@@ -34,58 +30,6 @@ ...@@ -34,58 +30,6 @@
#if !defined(bfill) && !defined(HAVE_BFILL) #if !defined(bfill) && !defined(HAVE_BFILL)
#if VaxAsm
void bfill(dst, len, fill)
char *dst;
uint len;
int fill; /* actually char */
{
asm("movc5 $0,*4(ap),12(ap),8(ap),*4(ap)");
}
#elif defined(MC68000) && defined(DS90)
void bfill(dst, len,fill) /* Optimized with long-fill */
char *dst;
uint len;
pchar fill;
{
asm(" movl 8.(a7),d1 ");
asm(" jeq .L9 ");
asm(" movl 4.(a7),a0 ");
asm(" moveq #0,d0 ");
asm(" movb 15.(a7),d0 ");
asm(" movl d2,a1 ");
asm(" movw d0,d2 ");
asm(" aslw #8,d0 ");
asm(" orw d2,d0 ");
asm(" movl d0,d2 ");
asm(" swap d0 ");
asm(" orl d2,d0 ");
asm(" movl a0,d2 ");
asm(" btst #0,d2 ");
asm(" jeq .L1 ");
asm(" movb d0,(a0)+ ");
asm(" subql #1,d1 ");
asm(".L1: movl d1,d2 ");
asm(" lsrl #2,d2 ");
asm(" jcc .L2 ");
asm(" movw d0,(a0)+ ");
asm(" jra .L2 ");
asm(".L3: movl d0,(a0)+ ");
asm(".L2: dbra d2,.L3 ");
asm(" addqw #1,d2 ");
asm(" subql #1,d2 ");
asm(" jcc .L3 ");
asm(" andl #1,d1 ");
asm(" jeq .L8 ");
asm(" movb d0,(a0) ");
asm(".L8: movl a1,d2 ");
asm(".L9: rts ");
}
#else
void bfill(dst, len, fill) void bfill(dst, len, fill)
register byte *dst; register byte *dst;
register uint len; register uint len;
...@@ -95,4 +39,3 @@ register pchar fill; ...@@ -95,4 +39,3 @@ register pchar fill;
} }
#endif #endif
#endif
...@@ -30,10 +30,6 @@ ...@@ -30,10 +30,6 @@
has its first two arguments the other way around you may find this a has its first two arguments the other way around you may find this a
bit easier to get right. bit easier to get right.
No value is returned. No value is returned.
Note: the "b" routines are there to exploit certain VAX order codes,
but the MOVC3 instruction will only move 65535 characters. The asm
code is presented for your interest and amusement.
*/ */
#include <my_global.h> #include <my_global.h>
...@@ -41,33 +37,6 @@ ...@@ -41,33 +37,6 @@
#if !defined(HAVE_BMOVE) && !defined(bmove) #if !defined(HAVE_BMOVE) && !defined(bmove)
#if VaxAsm
void bmove(dst, src, len)
char *dst, *src;
uint len;
{
asm("movc3 12(ap),*8(ap),*4(ap)");
}
#else
#if defined(MC68000) && defined(DS90)
void bmove(dst, src, len)
char *dst,*src;
uint len; /* 0 <= len <= 65535 */
{
asm(" movl 12(a7),d0 ");
asm(" subql #1,d0 ");
asm(" blt .L5 ");
asm(" movl 4(a7),a1 ");
asm(" movl 8(a7),a0 ");
asm(".L4: movb (a0)+,(a1)+ ");
asm(" dbf d0,.L4 ");
asm(".L5: ");
}
#else
void bmove(dst, src, len) void bmove(dst, src, len)
register char *dst; register char *dst;
register const char *src; register const char *src;
...@@ -75,6 +44,5 @@ register uint len; ...@@ -75,6 +44,5 @@ register uint len;
{ {
while (len-- != 0) *dst++ = *src++; while (len-- != 0) *dst++ = *src++;
} }
#endif
#endif
#endif #endif
...@@ -25,26 +25,8 @@ ...@@ -25,26 +25,8 @@
#include <my_global.h> #include <my_global.h>
#include "m_string.h" #include "m_string.h"
#if defined(MC68000) && defined(DS90)
/* 0 <= len <= 65535 */
void bmove_upp(byte *dst, const byte *src,uint len)
{
asm(" movl 12(a7),d0 ");
asm(" subql #1,d0 ");
asm(" blt .L5 ");
asm(" movl 4(a7),a1 ");
asm(" movl 8(a7),a0 ");
asm(".L4: movb -(a0),-(a1) ");
asm(" dbf d0,.L4 ");
asm(".L5: ");
}
#else
void bmove_upp(register uchar *dst, register const uchar *src, void bmove_upp(register uchar *dst, register const uchar *src,
register size_t len) register size_t len)
{ {
while (len-- != 0) *--dst = *--src; while (len-- != 0) *--dst = *--src;
} }
#endif
...@@ -25,23 +25,6 @@ ...@@ -25,23 +25,6 @@
#include <my_global.h> #include <my_global.h>
#include "m_string.h" #include "m_string.h"
#if defined(MC68000) && defined(DS90)
char *strcend(const char *s, pchar c)
{
asm(" movl 4(a7),a0 ");
asm(" movl 8(a7),d1 ");
asm(".L2: movb (a0)+,d0 ");
asm(" cmpb d0,d1 ");
asm(" beq .L1 ");
asm(" tstb d0 ");
asm(" bne .L2 ");
asm(".L1: movl a0,d0 ");
asm(" subql #1,d0 ");
}
#else
char *strcend(register const char *s, register pchar c) char *strcend(register const char *s, register pchar c)
{ {
for (;;) for (;;)
...@@ -51,4 +34,3 @@ char *strcend(register const char *s, register pchar c) ...@@ -51,4 +34,3 @@ char *strcend(register const char *s, register pchar c)
} }
} }
#endif
...@@ -24,27 +24,14 @@ ...@@ -24,27 +24,14 @@
is, strend(s)-s == strlen(s). This is useful for adding things at is, strend(s)-s == strlen(s). This is useful for adding things at
the end of strings. It is redundant, because strchr(s,'\0') could the end of strings. It is redundant, because strchr(s,'\0') could
be used instead, but this is clearer and faster. be used instead, but this is clearer and faster.
Beware: the asm version works only if strlen(s) < 65535.
*/ */
#include <my_global.h> #include <my_global.h>
#include "m_string.h" #include "m_string.h"
#if VaxAsm
char *strend(s)
const char *s;
{
asm("locc $0,$65535,*4(ap)");
asm("movl r1,r0");
}
#else /* ~VaxAsm */
char *strend(register const char *s) char *strend(register const char *s)
{ {
while (*s++); while (*s++);
return (char*) (s-1); return (char*) (s-1);
} }
#endif /* VaxAsm */
...@@ -29,25 +29,9 @@ ...@@ -29,25 +29,9 @@
#define strmov strmov_overlapp #define strmov strmov_overlapp
#endif #endif
#if !defined(MC68000) && !defined(DS90)
char *strmov(register char *dst, register const char *src) char *strmov(register char *dst, register const char *src)
{ {
while ((*dst++ = *src++)) ; while ((*dst++ = *src++)) ;
return dst-1; return dst-1;
} }
#else
char *strmov(dst, src)
char *dst, *src;
{
asm(" movl 4(a7),a1 ");
asm(" movl 8(a7),a0 ");
asm(".L4: movb (a0)+,(a1)+ ");
asm(" jne .L4 ");
asm(" movl a1,d0 ");
asm(" subql #1,d0 ");
}
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment