+2017-07-04 Uros Bizjak <ubizjak@gmail.com>
+
+ 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.
+
2017-07-04 Jakub Jelinek <jakub@redhat.com>
PR debug/81278
_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
_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
+2017-07-04 Uros Bizjak <ubizjak@gmail.com>
+
+ 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.
+
2017-07-04 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gcc.target/aarch64/simd/vminmaxnm_1.c: Fix strict aliasing issues.
sum_ref = 0x0;
/* X = 0x00000001, Y = 0x00000000, C = 0. */
- c = _subborrow_u32 (c, x, y, &x);
+ c = _subborrow_u32 (c, y, x, &x);
/* X = 0xFFFFFFFF, Y = 0x00000000, C = 1. */
- c = _subborrow_u32 (c, x, y, &x);
+ c = _subborrow_u32 (c, y, x, &x);
/* X = 0xFFFFFFFF, Y = 0xFFFFFFFF, C = 1. */
if (x != sum_ref)
sum_ref = 0x0LL;
/* X = 0x0000000000000001, Y = 0x0000000000000000, C = 0. */
- c = _subborrow_u64 (c, x, y, &x);
+ c = _subborrow_u64 (c, y, x, &x);
/* X = 0xFFFFFFFFFFFFFFFF, Y = 0x0000000000000000, C = 1. */
- c = _subborrow_u64 (c, x, y, &x);
+ c = _subborrow_u64 (c, y, x, &x);
/* X = 0x0000000000000000, Y = 0x0000000000000000, C = 1. */
if (x != sum_ref)
--- /dev/null
+/* PR target/81294 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+#include <x86intrin.h>
+
+int
+main ()
+{
+ volatile unsigned char c;
+ unsigned int x;
+ volatile unsigned int y, sum_ref;
+
+ c = 0;
+ x = 1;
+ y = 0;
+ sum_ref = 0x0;
+
+ /* X = 0x00000001, Y = 0x00000000, C = 0. */
+ c = _subborrow_u32 (c, y, x, &x);
+ /* X = 0xFFFFFFFF, Y = 0x00000000, C = 1. */
+ c = _subborrow_u32 (c, y, x, &x);
+ /* X = 0xFFFFFFFF, Y = 0xFFFFFFFF, C = 1. */
+
+ if (x != sum_ref)
+ __builtin_abort ();
+
+ return 0;
+}
--- /dev/null
+/* PR target/81294 */
+/* { dg-do run { target { ! ia32 } } } */
+/* { dg-options "-O2" } */
+
+#include <x86intrin.h>
+
+int main ()
+{
+ volatile unsigned char c;
+ unsigned long long x;
+ volatile unsigned long long y, sum_ref;
+
+ c = 0;
+ x = 1LL;
+ y = 0LL;
+ sum_ref = 0x0LL;
+
+ /* X = 0x0000000000000001, Y = 0x0000000000000000, C = 0. */
+ c = _subborrow_u64 (c, y, x, &x);
+ /* X = 0xFFFFFFFFFFFFFFFF, Y = 0x0000000000000000, C = 1. */
+ c = _subborrow_u64 (c, y, x, &x);
+ /* X = 0x0000000000000000, Y = 0x0000000000000000, C = 1. */
+
+ if (x != sum_ref)
+ __builtin_abort ();
+
+ return 0;
+}