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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [alpha/] [980217-1.c] - Blame information for rev 709

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
/* Test float on alpha. */
2
 
3
/* { dg-do run } */
4
/* { dg-options "-mieee -O2" } */
5
 
6
extern void abort(void);
7
extern int printf(const char *, ...);
8
 
9
typedef int int32_t __attribute__ ((__mode__ (  __SI__ ))) ;
10
typedef union
11
{
12
  float value;
13
  int32_t word;
14
} ieee_float_shape_type;
15
 
16
int isinff(float x)
17
{
18
  int32_t ix,t;
19
  ieee_float_shape_type gf_u;
20
  gf_u.value = x;
21
  ix = gf_u.word;
22
  printf ("%x\n", ix);
23
  t = ix & 0x7fffffff;
24
  t ^= 0x7f800000;
25
  t |= -t;
26
  return ~(t >> 31) & (1 - ((ix & 0x80000000) >> 30));
27
}
28
 
29
main ()
30
{
31
  float x = 1.0 / 0.0;
32
  int i = isinff (x);
33
 
34
  if (i == 0)
35
    abort ();
36
 
37
  printf ("%d\n", i);
38
  return 0;
39
}

powered by: WebSVN 2.1.0

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