Fix build with gcc-4.2. Problem reported and fix tested by joerg.

This commit is contained in:
wiz 2011-09-22 15:18:39 +00:00
parent c8fc585d13
commit 099d81f384
2 changed files with 12 additions and 6 deletions

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.12 2011/08/22 13:36:31 wiz Exp $
$NetBSD: distinfo,v 1.13 2011/09/22 15:18:39 wiz Exp $
SHA1 (openal-0.0.8.tar.gz) = 31aaedc18bd26759bd51f4fa495bc4ccb08acb3e
RMD160 (openal-0.0.8.tar.gz) = 29368dbceea7cfd8b5c520b9e0f0cfdc7324e265
@ -9,4 +9,4 @@ SHA1 (patch-ac) = a8911a1c8f421c9043df3ed5d7054a30f92eb635
SHA1 (patch-ad) = c740552ebcb4f846faa7ac17140753a6aac4393c
SHA1 (patch-ae) = 590a40890ccfe488248ef9d58c8991c07f0422d7
SHA1 (patch-common_include_AL_alc.h) = 22ee2edf133c5691487fc8628d3ef25d871dcb0d
SHA1 (patch-src_arch_i386_x86__floatmul.c) = c0e0f7468d5171c3c941187ed0764c89d0262035
SHA1 (patch-src_arch_i386_x86__floatmul.c) = ccd1a1a8780ba4f551df132cc22cc00be8580589

View file

@ -1,10 +1,10 @@
$NetBSD: patch-src_arch_i386_x86__floatmul.c,v 1.1 2011/08/22 13:36:31 wiz Exp $
$NetBSD: patch-src_arch_i386_x86__floatmul.c,v 1.2 2011/09/22 15:18:39 wiz Exp $
Fix build with gcc-4.5.
--- src/arch/i386/x86_floatmul.c.orig 2005-12-21 19:06:35.000000000 +0000
+++ src/arch/i386/x86_floatmul.c
@@ -82,11 +82,19 @@ void _alFloatMul(ALshort *bpt, ALfloat s
@@ -82,11 +82,27 @@ void _alFloatMul(ALshort *bpt, ALfloat s
v_sa.s[3] = v_sa.s[0];
while (samples_main--) {
@ -17,12 +17,18 @@ Fix build with gcc-4.5.
+ v_one.s[2] = 0;
+ v_one.s[3] = 0;
temp = __builtin_ia32_pmulhw(*(v4hi*)bpt, v_sa.v);
- *(v4hi*)bpt = __builtin_ia32_psllw(temp, 1LL);
+#if defined(__GNUC__) && defined(__GNUC_MINOR__) && (__GNUC__ <= 3 || (__GNUC__ == 4 && __GNUC_MINOR__ <= 2))
*(v4hi*)bpt = __builtin_ia32_psllw(temp, 1LL);
+#else
+ *(v4hi*)bpt = __builtin_ia32_psllw(temp, v_one.v);
+#endif
bpt += 4;
temp = __builtin_ia32_pmulhw(*(v4hi*)bpt, v_sa.v);
- *(v4hi*)bpt = __builtin_ia32_psllw(temp, 1LL);
+#if defined(__GNUC__) && defined(__GNUC_MINOR__) && (__GNUC__ <= 3 || (__GNUC__ == 4 && __GNUC_MINOR__ <= 2))
*(v4hi*)bpt = __builtin_ia32_psllw(temp, 1LL);
+#else
+ *(v4hi*)bpt = __builtin_ia32_psllw(temp, v_one.v);
+#endif
bpt += 4;
}
}