This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fixuns_trunf[sd]fdi2 patterns on SPARC64


[About fixuns_trunf[sd]fdi2 expanders modelled on optabs]

> Yes.  I do think there should be a better way to approach this
> problem, since iirc three ports have had to solve this so far.
> But until such time...

Thanks.  The patch bootstrapped/regtested on sparc64-sun-solaris2.9 and the 
attached testcase passed.  May I commit it with the patch?

> Patch looks good, btw.

Thanks :-)


2004-02-26  Eric Botcazou  <ebotcazou@act-europe.fr>

	* gcc.dg/fixuns-trunc-1.c: New test.


-- 
Eric Botcazou
/* { dg-do run } */
/* { dg-options "-std=c99" } */

unsigned long foo(double d)
{
  return (unsigned long) d;
}

extern void abort(void);

int main(void)
{
  double d;
  unsigned long l;

#ifdef __LP64__
  d = 9223372036854775808.0;
  l = 1LL << 63;

  if (foo(d) != l)
    abort();
#endif

  d = 122485.2;
  l = 122485;

  if (foo(d) != l)
    abort();

  return 0;
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]