File:  [UNIX Amiga Emulator] / uae / src / md-amiga / support.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:39:18 2018 UTC (8 years, 3 months ago) by root
Branches: MAIN, BSchmidt
CVS tags: uae068, HEAD
uae-0.6.8

 /* 
  * UAE - The Un*x Amiga Emulator
  * 
  * Miscellaneous machine dependent support functions and definitions
  *
  * Copyright 1996 Samuel Devulder
  */

#include "sysconfig.h"
#include "sysdeps.h"

#include "config.h"
#include "options.h"
#include "machdep/m68k.h"

struct flag_struct regflags;

/* Not used anyway */
int fast_memcmp(const void *foo, const void *bar, int len)
{
    return memcmp(foo, bar, len);
}

int memcmpy(void *foo, const void *bar, int len)
{
    /*    if(((int)foo)&1 || ((int)foo)&1) goto notaligned;
     * 
     */
    while((((short)len) -= 4) >= 0)
	if(*((long*)foo)++ != *((long*)bar)++)
	    goto diff4;
    ((short)len) += 4;
    
    notaligned:
    while(((short)len)--) {  /* ((short)len)-- will produce dbra => great ! */
	if (*((char*)foo)++ != *((char*)bar)++) { ((char*)foo)[-1] = ((char*)bar)[-1];
	    goto diff1;
	}
    }
    return 0;
    
    diff4:
    ((long*)foo)[-1] = ((long*)bar)[-1];
    while((((short)len)-=4) >= 0)
	*((long*)foo)++ = *((long*)bar)++;
    ((short)len) += 4;
    
    diff1:
    while(((short)len)--)
	*((char*)foo)++ = *((char*)bar)++;
    return 1;
    
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.