I'm very nervous about adding anything that allows you to tell which
distro/vendor/whatever a compiler came from.

Yes, there are applications where a careful user could use that
information, but the problem is that other people would use that macro
incorrectly, and before you know it you have entire packages that are
silently depending on these things. Then one day, Ubuntu ceases to use
Linaro compilers, and suddenly dozens of packages stop building for no
known reason, and all their dependencies also fail to build/install, and
it's the compiler team that gets the blame.

And, of course, you also gets sources that won't build on other distros,
etc.

The correct way to handle this is to add a macro per-feature that tells
you what form to use. Unfortunately, this really has to be done at the
time of the interface changes, or else you still have versions you don't
know what to do with.

I think that in this case, given that natty gcc is frozen and won't get
upgraded to 4.5.3, we should add a small patch which defines a macro
_MM_MASKSTORE_PS_NEEDS_NATTY_WORKAROUND. This will only ever exist in
natty gcc, and therefore very few people will ever know it exists, and
even fewer will have any interest in using it, so nothing will break
later.

You code would then be:

__m128 m, x;
float *mem;
#if !defined(_MM_MASKSTORE_PS_NEEDS_NATTY_WORKAROUND) && defined(__GNUC__) && 
__GNUC__ == 4 && (__GNUC_MINOR__ < 5 || (__GNUC_MINOR__ == 5 && 
__GNUC_PATCHLEVEL__ <= 2))
_mm_maskstore_ps(mem, m, x);
#else
_mm_maskstore_ps(mem, _mm_castps_si128(m), x);
#endif

You'd have to carry this slight nonsense in your source for while, but
it won't do any harm even if you kept it forever.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/780551

Title:
  incorrect interface in avxintrin.h

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to