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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [alpha/] [980217-1.c] - Blame information for rev 328

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

Line No. Rev Author Line
1 312 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.