aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/powerpc/vec-extract-uint128-1.c
blob: 8123bfaa06c31c7da087f6653a997889d4e42367 (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
   unsigned __int128s remains unsigned.  */
/* { 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(unsigned __int128 ul) {

  vector unsigned __int128 v = vec_splats(ul);

  if (vec_extract (v, 0) < ul)
    abort();
  return 0;
}

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