From: hjl@lucon.org (H.J. Lu)
To: mmitchell@usa.net
Cc: egcs@cygnus.com
Subject: cp/semantics.c is broken.
Date: Thu, 19 Mar 1998 12:55:00 -0000 [thread overview]
Message-ID: <m0yFkMr-00058iC@ocean.lucon.org> (raw)
Hi,
On x86,
# g++ -O2 -B/home/work/gnu/bin/egcs/gcc/ -c cw.cc -o cw.o
cw.cc: In function `double floor(double)':
cw.cc:9: warning: volatile qualifier ignored on asm
cw.cc:11: warning: volatile qualifier ignored on asm
cw.cc: In function `double ceil(double)':
cw.cc:21: warning: volatile qualifier ignored on asm
cw.cc:23: warning: volatile qualifier ignored on asm
/tmp/cca30122.s: Assembler messages:
/tmp/cca30122.s:31: Error: bad register name ('%0')
/tmp/cca30122.s:33: Error: bad register name ('%0')
It is from cp/semantics.c.
Thanks.
--
H.J. Lu (hjl@gnu.org)
---cw.cc--
extern "C" {
__inline double
floor (double __x)
{
register double __value;
__volatile unsigned short int __cw, __cwtmp;
__asm __volatile ("fnstcw %0" : "=m" (__cw));
__cwtmp = (__cw & 0xf3ff) | 0x0400;
__asm __volatile ("fldcw %0" : : "m" (__cwtmp));
__asm __volatile ("frndint" : "=t" (__value) : "0" (__x));
__asm __volatile ("fldcw %0" : : "m" (__cw));
return __value;
}
__inline double
ceil (double __x)
{
register double __value;
__volatile unsigned short int __cw, __cwtmp;
__asm __volatile ("fnstcw %0" : "=m" (__cw));
__cwtmp = (__cw & 0xf3ff) | 0x0800;
__asm __volatile ("fldcw %0" : : "m" (__cwtmp));
__asm __volatile ("frndint" : "=t" (__value) : "0" (__x));
__asm __volatile ("fldcw %0" : : "m" (__cw));
return __value;
}
}
class DiscreteUniform {
long pLow;
double delta;
public:
virtual double operator()();
};
double DiscreteUniform::operator()()
{
long tmp = long(floor(delta * 2.5));
return( double(pLow + tmp) );
}
next reply other threads:[~1998-03-19 12:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-03-19 12:55 H.J. Lu [this message]
-- strict thread matches above, loose matches on Subject: below --
1998-03-19 12:55 egcs-1.0.2, egcs-980315 and templates Andrew Pollard
1998-03-13 18:47 An x86 patch for egcs Mark Mitchell
[not found] ` <smtp.earthlink.net>
1998-03-13 18:29 ` H.J. Lu
1998-03-18 16:14 ` PATCH: add semantics.c Mark Mitchell
1998-03-19 21:47 ` PATCH for Re: cp/semantics.c is broken Mark Mitchell
1998-03-23 15:35 ` PATCH for Re: egcs-1.0.2, egcs-980315 and templates Andrew Pollard
1998-03-23 19:24 ` Mark Mitchell
1998-03-12 17:24 An x86 patch for egcs H.J. Lu
1998-03-16 19:46 ` Jim Wilson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m0yFkMr-00058iC@ocean.lucon.org \
--to=hjl@lucon.org \
--cc=egcs@cygnus.com \
--cc=mmitchell@usa.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).