On 20 March 2014 22:20, Marc Lehmann <[email protected]> wrote:

> On Thu, Mar 20, 2014 at 12:38:49PM +0200, Riku Voipio <
> [email protected]> wrote:
> > First part of the patch adds memory fence for aarch64. Strictly, this
> isn't
> > necessary, as the fallback to __atomic_thread_fence (__ATOMIC_SEQ_CST)
> > would output the same dmb ish instruction.
>
> Thanks!
>
> We indeed plan to move the test for __atomic_thread_fence to earlier in
> the file, so it would become the default (are there any gcc versions that
> support aarch64 but not __atomic_thread_fence? I guess not).
>

Gcc 4.8 is pretty much going to be the bottom line for Aarch64, so that
should be fine.


>
> However, if aarch64 has some efficient load and store barriers, using them
> could be advantegous, i.e., if you have efficient implementations for the
> _ACQUIRE and _RELEASE variants, these could be quite useful.
>
>
There is dmb ishld and dmb ishst which kernel uses for rmb and wmb. I don't
know if it is much faster. Need to wait for production hardware to see if
it's
worth the impact.


> > Second part makes sure the ancient arm float format doesn't get used.
>
> As a historical sidenote, the ancient arm float fornmat is precisely the
> reason behind this, btw. :)
>

Doesn't get used *accidentally*, I meant. Currently, if one just compiles
the current
libev on a new architecture, like aarch64, the ifdef will pick up the mixed
endian variant.
I think this will surprise many people.


> > Alternative would be to drop all ancient arm float support - anyone still
> > using the abi wouldn't be upgrading to new libev.
>
> Well, I am sure old arm isn't the only platform with nonstandard fp (and I
> suspect future platforms might switch as well), so I would prefer a change
> that simply adds aarch64 to the list of "sane" architectures.
>

Ok, I've attached a simplified patch that:

1) trusts gcc to give a working atomic_thread_fence
2) adds aarch64 to list of sane archs
3) warns if the old arm method gets used

Riku
--- a/ev.c
+++ b/ev.c
@@ -1053,10 +1053,12 @@
     || defined __alpha__ \
     || defined __hppa__ \
     || defined __ia64__ \
+    || defined __aarch64__ \
     || defined _M_IX86 || defined _M_AMD64 || defined _M_IA64
   #define ECB_STDFP 1
   #include <string.h> /* for memcpy */
 #else
+  #warning "Using old arm mixed floats"
   #define ECB_STDFP 0
   #include <math.h> /* for frexp*, ldexp* */
 #endif
_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to