aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/vec-extract-sint128-1.c
blob: 7d8582aa557ffa9bf2e69837776c91ea193ee23d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* Test to verify that the vec_extract from a vector of
   signed __int128s remains signed.  */
/* { dg-do run { target int128 } } */
/* { dg-options "-ansi -mdejagnu-cpu=power8 " } */
/* { dg-require-effective-target p8vector_hw } */

#include <altivec.h>
#include <stdio.h>
#include <stdlib.h>

int test1(signed __int128 st) {

  vector signed __int128 v = vec_splats(st);

  if (vec_extract (v, 0) > st)
    abort();
  return 0;
}

int main()
{
  test1 (((__int128) 0xf600000000000000LL) << 64);
  test1 (((__int128) 0x7600000000000000LL) << 64);
  test1 (((__int128) 0x0600000000000000LL) << 64);
  return 0;
}