Hi,

On 21 March 2014 18:40, Marc Lehmann <schm...@schmorp.de> wrote:
> On Fri, Mar 21, 2014 at 05:23:11PM +0100, Marc Lehmann <schm...@schmorp.de>
wrote:
> > I can synthesize this from your first patch, and your second patch (so
you
> > already gave me all the precious information I need). It would be nice
if
> > you could test it when it is finished, though :)

> Below is the patch I applied to ecb.h (I also updated ev.c in CVS). I have
> a few questions, to get it right:
>
> - I assume aarch64 always defines __arm__ (otherwise I cna just add
>   an explicit defined __arch64__, too).

 __aarch64__ doesn't define __arm__, most cases where one would ifdef
__arm__
would end up wrong with aarch64.

> - I assume I got the logic in the defined __arm__ branch right :)

looks good, only now there is two matches for __arm__ and eabi in the ifdef
:)

> - changing ANDROID to __ANDROID__ is ok (the former isn't allowed in iso
c,
>   and predef says the latter is the right one to test for).

Right, I think I tested with the latter one anyway, I don't know how that
ended
in the patch.

I've attached a patch to remove the duplicate arm case and adds __aarch64__,
although I'm sure you can do it as fast in editor than with applying patch
;)

> The effect should be that all arm platforms except the unknown ones (which
> presumably are all the old ones only) get the memcpy implementation, which
> would be a great improvement.

-snip- from other mail-
>safe fallback, i.e. it shuld work on every architecture, even the
> ones using ieee format in "expected" endianness.

I see, I missed that the code should work everywhere. Thanks for explaining!

> Thanks a lot for your input!

> @@ -144,6 +144,8 @@
>      #elif defined __ARM_ARCH_7__  || defined __ARM_ARCH_7A__  \
>         || defined __ARM_ARCH_7M__ || defined __ARM_ARCH_7R__
>        #define ECB_MEMORY_FENCE         __asm__ __volatile__ ("dmb"
 : : : "memory")
> +    #elif __aarch64__
> +      #define ECB_MEMORY_FENCE         __asm__ __volatile__ ("dmb ish"
 : : : "memory")
>      #elif (__sparc || __sparc__) && !__sparcv8
>        #define ECB_MEMORY_FENCE         __asm__ __volatile__ ("membar
#LoadStore | #LoadLoad | #StoreStore | #StoreLoad" : : : "memory")
>        #define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("membar
#LoadStore | #LoadLoad"                            : : : "memory")
> @@ -603,7 +605,8 @@ ecb_inline ecb_bool ecb_little_endian (v
>      || defined __m68k__ \
>      || defined __m88k__ \
>      || defined __sh__ \
> -    || defined _M_IX86 || defined _M_AMD64 || defined _M_IA64
> +    || defined _M_IX86 || defined _M_AMD64 || defined _M_IA64 \
> +    || (defined __arm__ && (defined __ARM_EABI__ || defined __EABI__ ||
defined __VFP_FP__ || defined _WIN32_WCE || defined __ANDROID__))
>    #define ECB_STDFP 1
>    #include <string.h> /* for memcpy */
>  #else
>
> --
>                 The choice of a       Deliantra, the free code+content
MORPG
>       -----==-     _GNU_              http://www.deliantra.net
>       ----==-- _       generation
>       ---==---(_)__  __ ____  __      Marc Lehmann
>       --==---/ / _ \/ // /\ \/ /      schm...@schmorp.de
>       -=====/_/_//_/\_,_/ /_/\_\
Index: ev.c
===================================================================
RCS file: /schmorpforge/libev/ev.c,v
retrieving revision 1.464
diff -u -4 -r1.464 ev.c
--- ev.c	21 Mar 2014 16:41:04 -0000	1.464
+++ ev.c	24 Mar 2014 07:18:13 -0000
@@ -1078,9 +1078,8 @@
 #if 0 \
     || __i386 || __i386__ \
     || __amd64 || __amd64__ || __x86_64 || __x86_64__ \
     || __powerpc__ || __ppc__ || __powerpc64__ || __ppc64__ \
-    || defined __arm__ && defined __ARM_EABI__ \
     || defined __s390__ || defined __s390x__ \
     || defined __mips__ \
     || defined __alpha__ \
     || defined __hppa__ \
@@ -1088,9 +1087,10 @@
     || defined __m68k__ \
     || defined __m88k__ \
     || defined __sh__ \
     || defined _M_IX86 || defined _M_AMD64 || defined _M_IA64 \
-    || (defined __arm__ && (defined __ARM_EABI__ || defined __EABI__ || defined __VFP_FP__ || defined _WIN32_WCE || defined __ANDROID__))
+    || (defined __arm__ && (defined __ARM_EABI__ || defined __EABI__ || defined __VFP_FP__ || defined _WIN32_WCE || defined __ANDROID__)) \
+    || defined __aarch64__
   #define ECB_STDFP 1
   #include <string.h> /* for memcpy */
 #else
   #define ECB_STDFP 0
_______________________________________________
libev mailing list
libev@lists.schmorp.de
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to