diff -r -u -N parrot-current/MANIFEST parrot-andy/MANIFEST --- parrot-current/MANIFEST 2009-04-01 08:10:29.806439217 -0400 +++ parrot-andy/MANIFEST 2009-04-01 08:48:50.591271694 -0400 @@ -211,12 +211,7 @@ config/auto/cgoto.pm [] config/auto/cgoto/test_c.in [] config/auto/cpu.pm [] -config/auto/cpu/i386/Makefile [] config/auto/cpu/i386/auto.pm [] -config/auto/cpu/i386/memcpy_mmx.c [] -config/auto/cpu/i386/memcpy_mmx_in.c [] -config/auto/cpu/i386/memcpy_sse.c [] -config/auto/cpu/i386/memcpy_sse_in.c [] config/auto/cpu/i386/test_gcc_cmpxchg_c.in [] config/auto/cpu/ppc/auto.pm [] config/auto/cpu/ppc/test_gcc_cmpset_c.in [] diff -r -u -N parrot-current/config/auto/cpu/i386/Makefile parrot-andy/config/auto/cpu/i386/Makefile --- parrot-current/config/auto/cpu/i386/Makefile 2009-04-01 08:10:27.602945948 -0400 +++ parrot-andy/config/auto/cpu/i386/Makefile 1969-12-31 19:00:00.000000000 -0500 @@ -1,17 +0,0 @@ -# use gcc/as to generate some files -# this file is not intended to be run during normal config -# but only by developers that change the source - - -all: memcpy_files - -memcpy_files: memcpy_mmx.c memcpy_sse.c - -memcpy_mmx.c: memcpy_mmx_in.c ../../../../tools/dev/as2c.pl - perl ../../../../tools/dev/as2c.pl memcpy_mmx_in > $@ - rm -f memcpy_mmx_in.s memcpy_mmx_in.o - -memcpy_sse.c: memcpy_sse_in.c ../../../../tools/dev/as2c.pl - perl ../../../../tools/dev/as2c.pl memcpy_sse_in > $@ - rm -f memcpy_sse_in.s memcpy_sse_in.o - diff -r -u -N parrot-current/config/auto/cpu/i386/auto.pm parrot-andy/config/auto/cpu/i386/auto.pm --- parrot-current/config/auto/cpu/i386/auto.pm 2009-04-01 08:10:27.598939762 -0400 +++ parrot-andy/config/auto/cpu/i386/auto.pm 2009-04-01 08:51:29.141939980 -0400 @@ -7,10 +7,10 @@ =head1 DESCRIPTION -Test for MMX/SSE functionality. Creates these Config entries +Test for cmpxchg ASM functionality. Creates these Config entries TEMP_generated => 'files ...' for inclusion in platform.c or platform.h - i386_has_mmx => 1 + i386_has_gcc_cmpxchg_c => 1 =cut @@ -24,25 +24,7 @@ my $verbose = $conf->options->get('verbose'); - my @files = qw( memcpy_mmx.c memcpy_sse.c ); - for my $f (@files) { - print " $f " if $verbose; - my ($suffix) = $f =~ /memcpy_(\w+)/; - my $path_f = "config/auto/cpu/i386/$f"; - $conf->cc_gen($path_f); - eval( $conf->cc_build("-DPARROT_CONFIG_TEST") ); - if ($@) { - print " $@ " if $verbose; - } - else { - if ( $conf->cc_run() =~ /ok/ ) { - _handle_cc_run_ok($conf, $suffix, $path_f, $verbose); - } - } - $conf->cc_clean(); - } - - @files = qw( test_gcc_cmpxchg_c.in ); + my @files = qw( test_gcc_cmpxchg_c.in ); for my $f (@files) { print " $f " if $verbose; my ($suffix) = $f =~ /test_(\w+)/; diff -r -u -N parrot-current/config/auto/cpu/i386/memcpy_mmx.c parrot-andy/config/auto/cpu/i386/memcpy_mmx.c --- parrot-current/config/auto/cpu/i386/memcpy_mmx.c 2009-04-01 08:10:27.602945948 -0400 +++ parrot-andy/config/auto/cpu/i386/memcpy_mmx.c 1969-12-31 19:00:00.000000000 -0500 @@ -1,103 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - * - * Generated from memcpy_mmx_in.c via memcpy_mmx_in.s - * by '../../../../tools/dev/as2c.pl memcpy_mmx_in' - */ - -/* - * GAS LISTING /home/chip/tmp/cci2hVe3.s page 1 - * - * - * 1 .file "memcpy_mmx_in.c" - * 2 .text - * 3 .p2align 4,,15 - * 4 .globl Parrot_memcpy_aligned_mmx - * - */ -static const char Parrot_memcpy_aligned_mmx_code[] = { - /* Parrot_memcpy_aligned_mmx: */ - 0x57, /* pushl %edi */ - 0x56, /* pushl %esi */ - 0x53, /* pushl %ebx */ - 0x83, 0xEC, 0x10, /* subl $16, %esp */ - 0x8B, 0x44, 0x24, 0x20, /* movl 32(%esp), %eax */ - 0x8B, 0x5C, 0x24, 0x24, /* movl 36(%esp), %ebx */ - 0x8B, 0x54, 0x24, 0x28, /* movl 40(%esp), %edx */ - 0xDD, 0x5C, 0x24, 0x08, /* fstpl 8(%esp) */ - 0x89, 0xC7, /* mov %eax, %edi */ - 0x89, 0xDE, /* mov %ebx, %esi */ - 0x89, 0xD1, /* mov %edx, %ecx */ - 0xC1, 0xE9, 0x04, /* shr $4, %ecx */ - /* 1: */ - 0x0F, 0x6F, 0x06, /* movq 0(%esi), %mm0 */ - 0x0F, 0x6F, 0x4E, 0x08, /* movq 8(%esi), %mm1 */ - 0x83, 0xC6, 0x10, /* add $16, %esi */ - 0x0F, 0x7F, 0x07, /* movq %mm0, 0(%edi) */ - 0x0F, 0x7F, 0x4F, 0x08, /* movq %mm1, 8(%edi) */ - 0x83, 0xC7, 0x10, /* add $16, %edi */ - 0x49, /* dec %ecx */ - 0x75, 0xE9, /* jnz 1b */ - 0x0F, 0x77, /* emms */ - 0xDD, 0x44, 0x24, 0x08, /* fldl 8(%esp) */ - 0x83, 0xC4, 0x10, /* addl $16, %esp */ - 0x5B, /* popl %ebx */ - 0x5E, /* popl %esi */ - 0x5F, /* popl %edi */ - 0xC3, /* ret */ - 0x00 -}; - -#include -typedef void* (*Parrot_memcpy_aligned_mmx_t)(void *dest, const void *src, size_t); - -#ifndef NDEBUG -#include -static void* -Parrot_memcpy_aligned_mmx_debug(void* d, const void* s, size_t n) -{ - assert( (n & 0xf) == 0); - assert( ((unsigned long) d & 7) == 0); - assert( ((unsigned long) s & 7) == 0); - return ((Parrot_memcpy_aligned_mmx_t)Parrot_memcpy_aligned_mmx_code)(d, s, n); -} - -Parrot_memcpy_aligned_mmx_t Parrot_memcpy_aligned_mmx = Parrot_memcpy_aligned_mmx_debug; - -#else -Parrot_memcpy_aligned_mmx_t Parrot_memcpy_aligned_mmx = - (Parrot_memcpy_aligned_mmx_t) Parrot_memcpy_aligned_mmx_code; -#endif - -#ifdef PARROT_CONFIG_TEST -#include -#include -int main(int argc, char *argv[]) { - unsigned char *s, *d; - size_t i, n; - - n = 640; /* sizeof(reg_store) */ - - s = (unsigned char *)malloc(n); - for (i = 0; i < n; ++i) - s[i] = i & 0xff; - d = (unsigned char *)malloc(n); - for (i = 0; i < n; ++i) - d[i] = 0xff; - Parrot_memcpy_aligned_mmx(d, s, n); - for (i = 0; i < n; ++i) - if (d[i] != (i & 0xff)) { - printf("error s[%d] = %d d = %d\n", i, s[i], d[i]); - exit(EXIT_FAILURE); - } - puts("ok"); - return 0; -} -#endif /* PARROT_CONFIG_TEST */ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4: - */ diff -r -u -N parrot-current/config/auto/cpu/i386/memcpy_mmx_in.c parrot-andy/config/auto/cpu/i386/memcpy_mmx_in.c --- parrot-current/config/auto/cpu/i386/memcpy_mmx_in.c 2009-04-01 08:10:27.598939762 -0400 +++ parrot-andy/config/auto/cpu/i386/memcpy_mmx_in.c 1969-12-31 19:00:00.000000000 -0500 @@ -1,95 +0,0 @@ -/* - * $Id: memcpy_mmx_in.c 36833 2009-02-17 20:09:26Z allison $ - * Copyright (C) 2004-2006, Parrot Foundation. - */ - -#include -void* -Parrot_memcpy_aligned_mmx(void *dest, const void *src, size_t n) -{ - double tos; - /* - * must preserve tos - need also a version with fstpt/fldt - */ - asm( - "fstpl %3\n\t" - "mov %0, %%edi\n\t" - "mov %1, %%esi\n\t" - "mov %2, %%ecx\n\t" - "shr $4, %%ecx\n\t" - "# .p2align 3\n\t" - "1:\n\t" - "movq 0(%%esi), %%mm0\n\t" - "movq 8(%%esi), %%mm1\n\t" - "add $16, %%esi\n\t" - "movq %%mm0, 0(%%edi)\n\t" - "movq %%mm1, 8(%%edi)\n\t" - "add $16, %%edi\n\t" - "dec %%ecx\n\t" - "jnz 1b\n\t" - "emms\n\t" - "fldl %3\n\t" - : /* no out */ - : "g"(dest), "g"(src), "g"(n), "m"(tos) - : "%esi", "%edi", "%ecx", "memory"); - - return dest; -} - -/*INTERFACE - -#include -typedef void* (*@FUNC@_t)(void *dest, const void *src, size_t); - -#ifndef NDEBUG -# include -static void* -@FUNC@_debug(void* d, const void* s, size_t n) -{ - assert( (n & 0xf) == 0); - assert( ((unsigned long) d & 7) == 0); - assert( ((unsigned long) s & 7) == 0); - return ((@FUNC@_t)@FUNC@_code)(d, s, n); -} - -@FUNC@_t @FUNC@ = @FUNC@_debug; - -#else -@FUNC@_t @FUNC@ = - (@FUNC@_t) @FUNC@_code; -#endif - -#ifdef PARROT_CONFIG_TEST -# include -# include -int main(int argc, char *argv[]) { - unsigned char *s, *d; - size_t i, n; - - n = 640; @* sizeof(reg_store) *@ - - s = malloc(n); - for (i = 0; i < n; ++i) - s[i] = i & 0xff; - d = malloc(n); - for (i = 0; i < n; ++i) - d[i] = 0xff; - @FUNC@(d, s, n); - for (i = 0; i < n; ++i) { - if (d[i] != (i & 0xff)) { - printf("error s[%d] = %d d = %d\n", i, s[i], d[i]); - exit(EXIT_FAILURE); - } - } - puts("ok"); - return 0; -} -#endif @* PARROT_CONFIG_TEST *@ -INTERFACE*/ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4: - */ diff -r -u -N parrot-current/config/auto/cpu/i386/memcpy_sse.c parrot-andy/config/auto/cpu/i386/memcpy_sse.c --- parrot-current/config/auto/cpu/i386/memcpy_sse.c 2009-04-01 08:10:27.598939762 -0400 +++ parrot-andy/config/auto/cpu/i386/memcpy_sse.c 1969-12-31 19:00:00.000000000 -0500 @@ -1,94 +0,0 @@ -/* - * DO NOT EDIT THIS FILE - * - * Generated from memcpy_sse_in.c via memcpy_sse_in.s - * by '../../../../tools/dev/as2c.pl memcpy_sse_in' - */ - -/* - * GAS LISTING /home/chip/tmp/ccvNpFsi.s page 1 - * - * - * 1 .file "memcpy_sse_in.c" - * 2 .text - * 3 .p2align 4,,15 - * 4 .globl Parrot_memcpy_aligned_sse - * - */ -static const char Parrot_memcpy_aligned_sse_code[] = { - /* Parrot_memcpy_aligned_sse: */ - 0x57, /* pushl %edi */ - 0x56, /* pushl %esi */ - 0x8B, 0x44, 0x24, 0x0C, /* movl 12(%esp), %eax */ - 0x8B, 0x4C, 0x24, 0x14, /* mov 20(%esp), %ecx */ - 0x8B, 0x74, 0x24, 0x10, /* mov 16(%esp), %esi */ - 0x89, 0xC7, /* mov %eax, %edi */ - 0xC1, 0xE9, 0x05, /* shr $5, %ecx */ - /* 1: */ - 0x0F, 0x10, 0x06, /* movups 0(%esi), %xmm0 */ - 0x0F, 0x10, 0x4E, 0x10, /* movups 16(%esi), %xmm1 */ - 0x83, 0xC6, 0x20, /* add $32, %esi */ - 0x0F, 0x11, 0x07, /* movups %xmm0, 0(%edi) */ - 0x0F, 0x11, 0x4F, 0x10, /* movups %xmm1, 16(%edi) */ - 0x83, 0xC7, 0x20, /* add $32, %edi */ - 0x49, /* dec %ecx */ - 0x75, 0xE9, /* jnz 1b */ - 0x5E, /* popl %esi */ - 0x5F, /* popl %edi */ - 0xC3, /* ret */ - 0x00 -}; - -#include -typedef void* (*Parrot_memcpy_aligned_sse_t)(void *dest, const void *src, size_t); - -#ifndef NDEBUG -#include -static void* -Parrot_memcpy_aligned_sse_debug(void* d, const void* s, size_t n) -{ - assert( (n & 0x1f) == 0); - assert( ((unsigned long) d & 7) == 0); - assert( ((unsigned long) s & 7) == 0); - return ((Parrot_memcpy_aligned_sse_t)Parrot_memcpy_aligned_sse_code)(d, s, n); -} - -Parrot_memcpy_aligned_sse_t Parrot_memcpy_aligned_sse = Parrot_memcpy_aligned_sse_debug; - -#else -Parrot_memcpy_aligned_sse_t Parrot_memcpy_aligned_sse = - (Parrot_memcpy_aligned_sse_t) Parrot_memcpy_aligned_sse_code; -#endif - -#ifdef PARROT_CONFIG_TEST -#include -#include -int main(int argc, char *argv[]) { - unsigned char *s, *d; - size_t i, n; - - n = 640; /* sizeof(reg_store) */ - - s = (unsigned char *)malloc(n); - for (i = 0; i < n; ++i) - s[i] = i & 0xff; - d = (unsigned char *)malloc(n); - for (i = 0; i < n; ++i) - d[i] = 0xff; - Parrot_memcpy_aligned_sse(d, s, n); - for (i = 0; i < n; ++i) - if (d[i] != (i & 0xff)) { - printf("error s[%d] = %d d = %d\n", i, s[i], d[i]); - exit(EXIT_FAILURE); - } - puts("ok"); - return 0; -} -#endif /* PARROT_CONFIG_TEST */ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4: - */ diff -r -u -N parrot-current/config/auto/cpu/i386/memcpy_sse_in.c parrot-andy/config/auto/cpu/i386/memcpy_sse_in.c --- parrot-current/config/auto/cpu/i386/memcpy_sse_in.c 2009-04-01 08:10:27.598939762 -0400 +++ parrot-andy/config/auto/cpu/i386/memcpy_sse_in.c 1969-12-31 19:00:00.000000000 -0500 @@ -1,85 +0,0 @@ -/* - * $Id: memcpy_sse_in.c 36833 2009-02-17 20:09:26Z allison $ - * Copyright (C) 2004-2006, Parrot Foundation. - */ - -#include -void* -Parrot_memcpy_aligned_sse(void *dest, const void *src, size_t n) -{ - asm( - "mov %0, %%ecx\n\t" - "mov %1, %%esi\n\t" - "mov %2, %%edi\n\t" - "shr $5, %%ecx\n\t" - "#.p2align 4\n\t" - "1:\n\t" - "movups 0(%%esi), %%xmm0\n\t" - "movups 16(%%esi), %%xmm1\n\t" - "add $32, %%esi\n\t" - "movups %%xmm0, 0(%%edi)\n\t" - "movups %%xmm1, 16(%%edi)\n\t" - "add $32, %%edi\n\t" - "dec %%ecx\n\t" - "jnz 1b\n\t" - - : : "g"(n), "g"(src), "g"(dest) : "%esi", "%edi", "%ecx"); - return dest; -} - -/*INTERFACE - -#include -typedef void* (*@FUNC@_t)(void *dest, const void *src, size_t); - -#ifndef NDEBUG -# include -static void* -@FUNC@_debug(void* d, const void* s, size_t n) -{ - assert( (n & 0x1f) == 0); - assert( ((unsigned long) d & 7) == 0); - assert( ((unsigned long) s & 7) == 0); - return ((@FUNC@_t)@FUNC@_code)(d, s, n); -} - -@FUNC@_t @FUNC@ = @FUNC@_debug; - -#else -@FUNC@_t @FUNC@ = - (@FUNC@_t) @FUNC@_code; -#endif - -#ifdef PARROT_CONFIG_TEST -# include -# include -int main(int argc, char *argv[]) { - unsigned char *s, *d; - size_t i, n; - - n = 640; @* sizeof(reg_store) *@ - - s = malloc(n); - for (i = 0; i < n; ++i) - s[i] = i & 0xff; - d = malloc(n); - for (i = 0; i < n; ++i) - d[i] = 0xff; - @FUNC@(d, s, n); - for (i = 0; i < n; ++i) - if (d[i] != (i & 0xff)) { - printf("error s[%d] = %d d = %d\n", i, s[i], d[i]); - exit(EXIT_FAILURE); - } - puts("ok"); - return 0; -} -#endif @* PARROT_CONFIG_TEST *@ -INTERFACE*/ - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4: - */ diff -r -u -N parrot-current/config/gen/platform/platform_interface.h parrot-andy/config/gen/platform/platform_interface.h --- parrot-current/config/gen/platform/platform_interface.h 2009-04-01 08:10:28.030939601 -0400 +++ parrot-andy/config/gen/platform/platform_interface.h 2009-04-01 08:13:25.953939560 -0400 @@ -48,26 +48,6 @@ # define mem_realloc_executable mem_sys_realloc #endif -void* Parrot_memcpy_aligned(void*, void*, size_t); - -#if defined(PARROT_HAS_I386_SSE) - -typedef void* (*Parrot_memcpy_func_t)(void *dest, const void *src, size_t); -extern Parrot_memcpy_func_t Parrot_memcpy_aligned_sse; - -# define Parrot_memcpy_aligned(d, s, l) Parrot_memcpy_aligned_sse((d), (s), (l)) - -#elif defined(PARROT_HAS_I386_MMX) - -typedef void* (*Parrot_memcpy_func_t)(void *dest, const void *src, size_t); -extern Parrot_memcpy_func_t Parrot_memcpy_aligned_mmx; - -# define Parrot_memcpy_aligned(d, s, l) Parrot_memcpy_aligned_mmx((d), (s), (l)) - -#else -# define Parrot_memcpy_aligned(d, s, l) mem_sys_memcopy((d), (s), (l)) -#endif - /* ** Time */