OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [eh/] [simd-5.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// Test EH with V2SI SIMD registers actually restores correct values.
2
// Origin: Joseph Myers 
3
// { dg-options "-O" }
4
// { dg-do run { target { powerpc_spe && { ! *-*-vxworks* } } } }
5
 
6
extern "C" void abort (void);
7
extern "C" int memcmp (const void *, const void *, __SIZE_TYPE__);
8
typedef int __attribute__((vector_size (8))) v2si;
9
 
10
v2si a = { 1, 2 };
11
v2si b = { 3, 4 };
12
v2si c = { 4, 6 };
13
volatile v2si r;
14
v2si r2;
15
 
16
void
17
f ()
18
{
19
  register v2si v asm("r15");
20
  v = __builtin_spe_evaddw (b, c);
21
  asm volatile ("" : "+r" (v));
22
  r = v;
23
  throw 1;
24
}
25
 
26
int
27
main ()
28
{
29
  register v2si v asm("r15");
30
  v = __builtin_spe_evaddw (a, b);
31
  asm volatile ("" : "+r" (v));
32
  try
33
    {
34
      f ();
35
    }
36
  catch (int)
37
    {
38
      r = v;
39
      r2 = r;
40
      if (memcmp (&r2, &c, sizeof (v2si)))
41
        abort ();
42
    }
43
  return 0;
44
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.