|
|
1.1 root 1: /*
2: * UAE - The Un*x Amiga Emulator
3: *
4: * Miscellaneous machine dependent support functions and definitions
5: *
6: * Copyright 1996 Samuel Devulder
7: */
8:
9: #include "sysconfig.h"
10: #include "sysdeps.h"
11:
12: #include "config.h"
13: #include "options.h"
14: #include "machdep/m68k.h"
15:
16: struct flag_struct regflags;
17:
18: /* Not used anyway */
19: int fast_memcmp(const void *foo, const void *bar, int len)
20: {
21: return memcmp(foo, bar, len);
22: }
23:
24: int memcmpy(void *foo, const void *bar, int len)
25: {
26: /* if(((int)foo)&1 || ((int)foo)&1) goto notaligned;
27: *
28: */
29: while((((short)len) -= 4) >= 0)
30: if(*((long*)foo)++ != *((long*)bar)++)
31: goto diff4;
32: ((short)len) += 4;
33:
34: notaligned:
35: while(((short)len)--) { /* ((short)len)-- will produce dbra => great ! */
36: if (*((char*)foo)++ != *((char*)bar)++) { ((char*)foo)[-1] = ((char*)bar)[-1];
37: goto diff1;
38: }
39: }
40: return 0;
41:
42: diff4:
43: ((long*)foo)[-1] = ((long*)bar)[-1];
44: while((((short)len)-=4) >= 0)
45: *((long*)foo)++ = *((long*)bar)++;
46: ((short)len) += 4;
47:
48: diff1:
49: while(((short)len)--)
50: *((char*)foo)++ = *((char*)bar)++;
51: return 1;
52:
53: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.