+2018-11-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/87817
+ * config/i386/i386.c (ix86_fold_builtin): For _bzhi_u{32,64} if
+ last argument has low 8 bits clear, fold to 0.
+
2018-11-14 Iain Sandoe <iain@sandoe.co.uk>
* tree-vect-data-refs.c (vect_can_force_dr_alignment_p): Cast
unsigned int idx = tree_to_uhwi (args[1]) & 0xff;
if (idx >= TYPE_PRECISION (TREE_TYPE (args[0])))
return args[0];
+ if (idx == 0)
+ return build_int_cst (TREE_TYPE (TREE_TYPE (fndecl)), 0);
if (!tree_fits_uhwi_p (args[0]))
break;
unsigned HOST_WIDE_INT res = tree_to_uhwi (args[0]);
+2018-11-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/87817
+ * gcc.target/i386/bmi2-bzhi-3.c (main): Add a couple of new tests.
+
2018-11-14 Wilco Dijkstra <wdijkstr@arm.com>
* gcc.target/aarch64/pr62178.c: Relax scan-assembler checks.
link_error ();
if (_bzhi_u32 (c, 32) != c
|| _bzhi_u32 (c, 64) != c
- || _bzhi_u32 (c, 255) != c)
+ || _bzhi_u32 (c, 255) != c
+ || _bzhi_u32 (c, 544) != c
+ || _bzhi_u32 (c, 0) != 0
+ || _bzhi_u32 (c, 256) != 0
+ || _bzhi_u32 (c, 1024) != 0)
link_error ();
#ifdef __x86_64__
if (f21 () != 0 || f22 (-1ULL) != 0
|| f33 () != -1ULL || f34 (-1ULL) != -1ULL)
link_error ();
if (_bzhi_u64 (d, 64) != d
- || _bzhi_u64 (d, 255) != d)
+ || _bzhi_u64 (d, 255) != d
+ || _bzhi_u64 (d, 576) != d
+ || _bzhi_u64 (d, 0) != 0
+ || _bzhi_u64 (d, 256) != 0
+ || _bzhi_u64 (d, 512) != 0)
link_error ();
#endif
return 0;