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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [powerpc/] [pr48053-3.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do compile } */
2
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
3
/* { dg-require-effective-target powerpc_vsx_ok } */
4
/* { dg-options "-O3 -mcpu=power7" } */
5
 
6
/* Cut down example from s_scalbnl that aborted on 32-bit when the fix for
7
   48053 went in to allow creating DImode 0's in VSX registers.  */
8
 
9
typedef union
10
{
11
  long double value;
12
  struct
13
  {
14
    unsigned long long msw;
15
    unsigned long long lsw;
16
  } parts64;
17
  struct
18
  {
19
    unsigned int w0, w1, w2, w3;
20
  } parts32;
21
} ieee854_long_double_shape_type;
22
 
23
static const long double twolm54 = 5.55111512312578270212e-17;
24
 
25
long double foo (long double x, int n)
26
{
27
  long long k, hx, lx;
28
  ieee854_long_double_shape_type qw_u;
29
 
30
  qw_u.value = x;
31
  hx = qw_u.parts64.msw;
32
  lx = qw_u.parts64.lsw;
33
 
34
  k = ((hx >> 52) & 0x7ff) + n + 54;
35
 
36
  qw_u.parts64.msw = ((hx & 0x800fffffffffffffULL) | (k << 52));
37
  qw_u.parts64.lsw = lx;
38
  x = qw_u.value;
39
 
40
  return x*twolm54;
41
}

powered by: WebSVN 2.1.0

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