http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51387
Michael Zolotukhin <michael.v.zolotukhin at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michael.v.zolotukhin at | |gmail dot com --- Comment #1 from Michael Zolotukhin <michael.v.zolotukhin at gmail dot com> 2011-12-02 05:53:25 UTC --- I added prints to the test and saw that the result was incorrectly permuted (bytes 8-15 and 16-23 should be swapped): i C[i] correct C[i] 0 0 0 1 1 1 2 4 4 3 9 9 4 16 16 5 25 25 6 36 36 7 49 49 8 0 64 9 33 81 10 68 100 11 105 121 12 144 144 13 185 169 14 228 196 15 17 225 16 64 0 17 81 33 18 100 68 19 121 105 20 144 144 21 169 185 22 196 228 23 225 17 24 64 64 25 113 113 26 164 164 27 217 217 28 16 16 29 73 73 30 132 132 31 193 193 Looks like there is a problem in function expand_vec_perm_vpshufb2_vpermq_even_odd (config/i386/i386.c) in this code: /* Permute the V4DImode quarters using { 0, 2, 1, 3 } permutation. */ op = gen_lowpart (V4DImode, d->target); ior = gen_lowpart (V4DImode, ior); emit_insn (gen_avx2_permv4di_1 (op, ior, const0_rtx, const2_rtx, const1_rtx, GEN_INT (3))); What do we need this permute for?