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