DONE;
})
-;; Vector reverse elements
-(define_expand "altivec_vreveti2"
- [(set (match_operand:TI 0 "register_operand" "=v")
- (unspec:TI [(match_operand:TI 1 "register_operand" "v")]
- UNSPEC_VREVEV))]
- "TARGET_ALTIVEC"
-{
- int i, j, size, num_elements;
- rtvec v = rtvec_alloc (16);
- rtx mask = gen_reg_rtx (V16QImode);
-
- size = GET_MODE_UNIT_SIZE (TImode);
- num_elements = GET_MODE_NUNITS (TImode);
-
- for (j = 0; j < num_elements; j++)
- for (i = 0; i < size; i++)
- RTVEC_ELT (v, i + j * size)
- = GEN_INT (i + (num_elements - 1 - j) * size);
-
- emit_insn (gen_vec_initv16qiqi (mask, gen_rtx_PARALLEL (V16QImode, v)));
- emit_insn (gen_altivec_vperm_ti (operands[0], operands[1],
- operands[1], mask));
- DONE;
-})
-
;; Vector reverse elements for V16QI V8HI V4SI V4SF
(define_expand "altivec_vreve<mode>2"
[(set (match_operand:VEC_K 0 "register_operand" "=v")
rtx vec_tmp = operands[3];
int value;
+ /* Adjust index for LE element ordering, the below minuend 3 is computed by
+ GET_MODE_NUNITS (V4SImode) - 1. */
if (!BYTES_BIG_ENDIAN)
- element = GEN_INT (GET_MODE_NUNITS (V4SImode) - 1 - INTVAL (element));
+ element = GEN_INT (3 - INTVAL (element));
/* If the value is in the correct position, we can avoid doing the VSPLT<x>
instruction. */
rtx v4si_tmp = operands[3];
int value;
+ /* Adjust index for LE element ordering, the below minuend 3 is computed by
+ GET_MODE_NUNITS (V4SImode) - 1. */
if (!BYTES_BIG_ENDIAN)
- element = GEN_INT (GET_MODE_NUNITS (V4SImode) - 1 - INTVAL (element));
+ element = GEN_INT (3 - INTVAL (element));
/* If the value is in the correct position, we can avoid doing the VSPLT<x>
instruction. */
rtx df_tmp = operands[4];
int value;
+ /* Adjust index for LE element ordering, the below minuend 3 is computed by
+ GET_MODE_NUNITS (V4SImode) - 1. */
if (!BYTES_BIG_ENDIAN)
- element = GEN_INT (GET_MODE_NUNITS (V4SImode) - 1 - INTVAL (element));
+ element = GEN_INT (3 - INTVAL (element));
/* If the value is in the correct position, we can avoid doing the VSPLT<x>
instruction. */
{
int ele = INTVAL (operands[4]);
+ /* Adjust index for LE element ordering, the below minuend 3 is computed by
+ GET_MODE_NUNITS (V4SFmode) - 1. */
if (!BYTES_BIG_ENDIAN)
- ele = GET_MODE_NUNITS (V4SFmode) - 1 - ele;
+ ele = 3 - ele;
operands[4] = GEN_INT (GET_MODE_SIZE (SFmode) * ele);
return "xxinsertw %x0,%x2,%4";