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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [tic6x/] [builtins/] [sarith1.c] - Blame information for rev 691

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
#include <c6x_intrinsics.h>
2
 
3
extern void abort (void);
4
 
5
int a1 = 0x50000000;
6
int b1 = 0xc0000000;
7
int c1 = 0x40000000;
8
int a2 = 0xd0000000;
9
int b2 = 0x20000000;
10
int c2 = 0x90000000;
11
int d = 0x80000000;
12
 
13
int main ()
14
{
15
  if (_sadd (a1, b1) != 0x10000000)
16
    abort ();
17
  if (_sadd (a2, b2) != 0xf0000000)
18
    abort ();
19
  if (_sadd (a1, c1) != 0x7fffffff)
20
    abort ();
21
  if (_sadd (a2, c2) != 0x80000000)
22
    abort ();
23
 
24
  if (_ssub (a1, b1) != 0x7fffffff)
25
    abort ();
26
  if (_ssub (a2, b2) != 0xb0000000)
27
    abort ();
28
  if (_ssub (b1, a1) != 0x80000000)
29
    abort ();
30
  if (_ssub (b2, a2) != 0x50000000)
31
    abort ();
32
 
33
  if (_abs (a1) != 0x50000000)
34
    abort ();
35
  if (_abs (b1) != 0x40000000)
36
    abort ();
37
  if (_abs (d) != 0x7fffffff)
38
    abort ();
39
 
40
  if (_sshl (a1, 1) != 0x7fffffff
41
      || _sshl (b2, 1) != 0x40000000
42
      || _sshl (a2, 1) != 0xa0000000
43
      || _sshl (a2, 4) != 0x80000000)
44
    abort ();
45
 
46
  return 0;
47
}

powered by: WebSVN 2.1.0

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