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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.target/] [i386/] [brokensqrt.c] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 318 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O2 -ffast-math -msse -mfpmath=sse -mrecip" } */
3
/* { dg-require-effective-target sse } */
4
#include "sse-check.h"
5
 
6
extern float sqrtf (float);
7
float __attribute__((noinline)) broken (float a, float b)
8
{
9
  return sqrtf (a / b);
10
}
11
 
12
extern void abort (void);
13
extern void *memcpy (void *, const void *, __SIZE_TYPE__);
14
static void
15
sse_test (void)
16
{
17
  int i;
18
  float x;
19
  char buf[sizeof (float)];
20
  x = broken (0.0f, 10000.0f);
21
  /* A convoluted way to check for the correct result (zero) for all
22
     floating point formats.
23
     We can't use ==, !=, or range checks, or isinf/isnan/isunordered,
24
     because all of these will not do the right thing under -ffast-math,
25
     as they can assume that neither nan nor inf are returned.  */
26
  memcpy (&buf, &x, sizeof (float));
27
  for (i = 0; i < sizeof (float); i++)
28
    if (buf[i] != 0)
29
      abort ();
30
}

powered by: WebSVN 2.1.0

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