Summary: | _subborrow_u64 argument order inconsistent with intrinsic reference, icc | ||
---|---|---|---|
Product: | gcc | Reporter: | andreser-gccbugs |
Component: | target | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | hjl.tools, jakub, kyukhin, uros |
Priority: | P3 | Keywords: | wrong-code |
Version: | 7.1.1 | ||
Target Milestone: | 7.2 | ||
Host: | Target: | x86 | |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: |
Description
andreser-gccbugs
2017-07-03 15:49:49 UTC
Seems LLVM also agrees with ICC implementation (rather than the past documentation). It looks like (now fixed) bug in the documentation. So, following patch should sync gcc with the fixed docs: --cut here-- Index: adxintrin.h =================================================================== --- adxintrin.h (revision 249844) +++ adxintrin.h (working copy) @@ -33,7 +33,7 @@ _subborrow_u32 (unsigned char __CF, unsigned int __X, unsigned int __Y, unsigned int *__P) { - return __builtin_ia32_sbb_u32 (__CF, __Y, __X, __P); + return __builtin_ia32_sbb_u32 (__CF, __X, __Y, __P); } extern __inline unsigned char @@ -58,7 +58,7 @@ _subborrow_u64 (unsigned char __CF, unsigned long long __X, unsigned long long __Y, unsigned long long *__P) { - return __builtin_ia32_sbb_u64 (__CF, __Y, __X, __P); + return __builtin_ia32_sbb_u64 (__CF, __X, __Y, __P); } extern __inline unsigned char --cut here-- Author: uros Date: Tue Jul 4 20:46:38 2017 New Revision: 249976 URL: https://gcc.gnu.org/viewcvs?rev=249976&root=gcc&view=rev Log: PR target/81294 * config/i386/adxintrin.h (_subborrow_u32): Swap _X and _Y arguments in the call to __builtin_ia32_sbb_u32. (_subborrow_u64): Swap _X and _Y arguments in the call to __builtin_ia32_sbb_u64. testsuite/ChangeLog: PR target/81294 * gcc.target/i386/adx-addcarryx32-2.c (adx_test): Swap x and y arguments in the call to _subborrow_u32. * gcc.target/i386/adx-addcarryx64-2.c (adx_test): Swap x and y arguments in the call to _subborrow_u64. * gcc.target/i386/pr81294-1.c: New test. * gcc.target/i386/pr81294-2.c: Ditto. Added: trunk/gcc/testsuite/gcc.target/i386/pr81294-1.c trunk/gcc/testsuite/gcc.target/i386/pr81294-2.c Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/adxintrin.h trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.target/i386/adx-addcarryx32-2.c trunk/gcc/testsuite/gcc.target/i386/adx-addcarryx64-2.c Author: uros Date: Tue Jul 4 21:05:17 2017 New Revision: 249978 URL: https://gcc.gnu.org/viewcvs?rev=249978&root=gcc&view=rev Log: PR target/81300 * config/i386/i386.md (setcc + movzbl/and to xor + setcc peepholes): Require dead FLAGS_REG at the beginning of a peephole. PR target/81294 * config/i386/adxintrin.h (_subborrow_u32): Swap _X and _Y arguments in the call to __builtin_ia32_sbb_u32. (_subborrow_u64): Swap _X and _Y arguments in the call to __builtin_ia32_sbb_u64. testsuite/ChangeLog: PR target/81300 * gcc.target/i386/pr81300.c: New test. PR target/81294 * gcc.target/i386/adx-addcarryx32-2.c (adx_test): Swap x and y arguments in the call to _subborrow_u32. * gcc.target/i386/adx-addcarryx64-2.c (adx_test): Swap x and y arguments in the call to _subborrow_u64. * gcc.target/i386/pr81294-1.c: New test. * gcc.target/i386/pr81294-2.c: Ditto. Added: branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr81294-1.c branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr81294-2.c branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr81300.c Modified: branches/gcc-7-branch/gcc/ChangeLog branches/gcc-7-branch/gcc/config/i386/adxintrin.h branches/gcc-7-branch/gcc/config/i386/i386.md branches/gcc-7-branch/gcc/testsuite/ChangeLog branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/adx-addcarryx32-2.c branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/adx-addcarryx64-2.c Fixed for gcc-7.2+. |