In the "GCC online documentation" in the page entitled "5.45.5 X86 Built-in Functions" the lines documenting the addsubps and addsubpd instructions are listed as: v2df __builtin_ia32_addsubpd (v2df, v2df) v2df __builtin_ia32_addsubps (v2df, v2df) The first line is correct as can be deduced by the hungarian notation of double as 'd' as the last letter. However the second line is a float operator yet the prototype given implies it to be a float operator. This is not the case as putting a v2df into the function results in an error. For instance take the following code: #include <stdio.h> typedef double v2df __attribute__ ((vector_size (16))); int main() { v2df a, b, c; c = __builtin_ia32_addsubps (a, b); return 1; } Attempting to compile this will result in the following error: error: incompatible types in assignment A simple change to v4sf will allow the code to compile, and I have verified that it works according to spec. Also all online documentation for the assembly instruction associated with this call, addsubps, document it as a 4-vector single precision float operator. As a side comment I noticed that none of the sse2 instructions were listed on this page, yet also exist. For instance the instructions __builtin_ia32_addpd __builtin_ia32_subpd __builtin_ia32_mulpd __builtin_ia32_divpd do not exist on this page yet should. I appreciate the help that this online documentation has provided. I dislike using asm on code that needs to be created and maintained in my enviornment, where little or no training on assembly is done or desired. We perform much work on datasets of complex numbers and this documentation has allowed a simple yet fast and efficient way to perform complex multiplications and other operations. Here is for instance a macro for a complex multiplication: // using SSE3 instructions #define v4sf_complex_mult( a, b) __builtin_ia32_addsubps ( \ __builtin_ia32_movsldup (a) * (b), \ __builtin_ia32_movshdup (a) * __builtin_ia32_shufps (b, b, 0xb1) )
You should be using the Intel intrinsics by using {x,}mmintrin.h/mm3dnow.h.
The documention should just reference the Intel intrinsics. Confirmed.
This is a documentation regression as now, the builtins are inconstaint with the source.
*** Bug 23218 has been marked as a duplicate of this bug. ***
Subject: Bug number PR25519 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-10/msg00542.html
Subject: Bug 25519 Author: rguenth Date: Mon Oct 16 08:36:03 2006 New Revision: 117774 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117774 Log: 2006-10-16 Richard Guenther <rguenther@suse.de> PR target/25519 * doc/extend.texi (X86 Built-in Functions): Fix typos in SSE builtin documentation. Document SSE2 builtins. Modified: trunk/gcc/ChangeLog trunk/gcc/doc/extend.texi
Subject: Bug 25519 Author: rguenth Date: Mon Oct 16 08:38:52 2006 New Revision: 117775 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117775 Log: 2006-10-16 Richard Guenther <rguenther@suse.de> PR target/25519 * doc/extend.texi (X86 Built-in Functions): Fix typos in SSE builtin documentation. Document SSE2 builtins. Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/doc/extend.texi
Subject: Bug 25519 Author: rguenth Date: Mon Oct 16 08:40:32 2006 New Revision: 117776 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117776 Log: 2006-10-16 Richard Guenther <rguenther@suse.de> PR target/25519 * doc/extend.texi (X86 Built-in Functions): Fix typos in SSE builtin documentation. Document SSE2 builtins. Modified: branches/gcc-4_0-branch/gcc/ChangeLog branches/gcc-4_0-branch/gcc/doc/extend.texi
SSE2 builtins are now documented, so not a regression anymore. Still a paragraph mentioning the intrinsics could improve the situation.
*** Bug 20049 has been marked as a duplicate of this bug. ***