Re: Option to make unsigned->signed conversion always well-defined?

2011-10-06 Thread Ulf Magnusson
On Thu, Oct 6, 2011 at 12:55 AM, Pedro Pedruzzi wrote: > Em 05-10-2011 17:11, Ulf Magnusson escreveu: >> Hi, >> >> I've been experimenting with different methods for emulating the >> signed overflow of an 8-bit CPU. > > You would like to check whether a 8-bit signed addition will overflow or > not

Re: Option to make unsigned->signed conversion always well-defined?

2011-10-06 Thread Ulf Magnusson
On Thu, Oct 6, 2011 at 10:25 AM, Ulf Magnusson wrote: > On Thu, Oct 6, 2011 at 12:55 AM, Pedro Pedruzzi > wrote: >> Em 05-10-2011 17:11, Ulf Magnusson escreveu: >>> Hi, >>> >>> I've been experimenting with different methods for emulating the >>> signed overflow of an 8-bit CPU. >> >> You would li

Re: Option to make unsigned->signed conversion always well-defined?

2011-10-06 Thread Miles Bader
Ulf Magnusson writes: > Might as well do > > bool overflowbit(unsigned int a, unsigned int b) { > const unsigned int sum = a + b; > return (a ^ b) & ~(a ^ sum) & 0x80; > } > > But still not very good output compared to other approaches as expected. How about: bool overflowbit2(unsigne

Re: Option to make unsigned->signed conversion always well-defined?

2011-10-06 Thread Ulf Magnusson
On Thu, Oct 6, 2011 at 11:04 AM, Miles Bader wrote: > Ulf Magnusson writes: >> Might as well do >> >> bool overflowbit(unsigned int a, unsigned int b) { >>     const unsigned int sum = a + b; >>     return (a ^ b) & ~(a ^ sum) & 0x80; >> } >> >> But still not very good output compared to other ap

Bugzilla down

2011-10-06 Thread Paulo J. Matos
Suddenly bugzilla went down. Am I the only one seeing this? -- PMatos

Re: Merging gdc (GNU D Compiler) into gcc

2011-10-06 Thread Iain Buclaw
On 4 October 2011 09:41, Andrew Haley wrote: > On 10/04/2011 08:08 AM, Iain Buclaw wrote: > >> I've have received news from Walter Bright that the license of the D >> frontend has been assigned to the FSF. As the current maintainer of >> GDC, I would like to get this moved forward, starting with g

Re: Bugzilla down

2011-10-06 Thread Paolo Carlini
On 10/06/2011 04:41 PM, Paulo J. Matos wrote: Suddenly bugzilla went down. Am I the only one seeing this? Actually, the whole gcc.gnu.org since yesterday seems rather flaky. At the moment it works fine for me, though. Paolo.

Re: Bugzilla down

2011-10-06 Thread Paulo J. Matos
On 06/10/11 15:41, Paulo J. Matos wrote: Suddenly bugzilla went down. Am I the only one seeing this? Opps, now sorted. -- PMatos

Re: Bugzilla down

2011-10-06 Thread octoploid
Paolo Carlini oracle.com> writes: > > On 10/06/2011 04:41 PM, Paulo J. Matos wrote: > > Suddenly bugzilla went down. > > Am I the only one seeing this? > Actually, the whole gcc.gnu.org since yesterday seems rather flaky. At > the moment it works fine for me, though. Same symptoms as those on

Re: Option to make unsigned->signed conversion always well-defined?

2011-10-06 Thread Jeremy Hall
Hi. Instead of all the clever bit twiddling I have used code similar to sum > UINT8_MAX which just generates cmp ax,255 seta al which seems to be far more efficient (even the signed version gets optimized down to the above single check). Please could someone tell me if I have

Re: float "op-and-halve"

2011-10-06 Thread Richard Henderson
On 10/05/2011 07:16 PM, David Miller wrote: > From: David Bremner > Date: Wed, 5 Oct 2011 19:08:41 -0700 > >> What about treating these instructions as fused multiply-adds with >> constant arguments? > > Richard Henderson (CC:'d) chatted with me the other day about this and > made the same initi

Re: Option to make unsigned->signed conversion always well-defined?

2011-10-06 Thread Pedro Pedruzzi
On Thu, Oct 6, 2011 at 11:04 AM, Miles Bader wrote: > How about: > > bool overflowbit2(unsigned int a, unsigned int b) > { > const unsigned int sum = a + b; > return ~(a ^ b) & sum & 0x80; > } > > ? > > I thik it has the same results as your function... > [I just made a table

Re: Option to make unsigned->signed conversion always well-defined?

2011-10-06 Thread Ulf Magnusson
(I'll cross-post this to gcc and keep it on gcc-help after that.) On Thu, Oct 6, 2011 at 4:46 PM, Andrew Haley wrote: > > inline int8_t as_signed_8 (unsigned int a) { > a &= 0xff; > return a & 0x80 ? (int)a - 0x100 : a; > } > > int overflow(unsigned int a, unsigned int b) { > int sum = as_sign

Re: Bugzilla down

2011-10-06 Thread Frank Ch. Eigler
octoploid writes: >> Actually, the whole gcc.gnu.org since yesterday seems rather flaky. At >> the moment it works fine for me, though. > > Same symptoms as those on kernel.org In gcc.gnu.org's case, apparently this was being caused by someone hammering on the bugzilla server. A case of exces

Re: Option to make unsigned->signed conversion always well-defined?

2011-10-06 Thread Florian Weimer
* Ulf Magnusson: > I've been experimenting with different methods for emulating the > signed overflow of an 8-bit CPU. The method I've found that seems to > generate the most efficient code on both ARM and x86 is > > bool overflow(unsigned int a, unsigned int b) { > const unsigned int sum = (i

Re: onlinedocs formated text too small to read

2011-10-06 Thread Jon Grant
Georg-Johann Lay wrote, On 01/08/11 09:40: Jon Grant wrote: [.] http://gcc.gnu.org/ml/gcc/2011-07/msg00106.html CCed Gerald, I think he cares for that kind of things. If he does not answer (it's vacation time) file a PR so that it won't be forgotten. Johann Thank you. I filled a PR now:

Re: cc1.exe: warnings being treated as errors

2011-10-06 Thread Jon Grant
Jonathan Wakely wrote, On 26/09/11 09:57: [.] Feel free to request a new option in Bugzilla to suppress the note, that's the right place for this discussion. Good point. I've created a ticket: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50643 Regards, Jon

Re: The AST tree modification. Edited.

2011-10-06 Thread Andi Hellmund
Hi, as an addition to Balaji's answer. Please find attached an extract of a sample front-end generating various types of tree nodes (e.g. arrays, structs, ...). This used to work with an older version of GCC, but I'm not sure if this still works with the most recent version. Anyway, it should

gcc-4.5-20111006 is now available

2011-10-06 Thread gccadmin
Snapshot gcc-4.5-20111006 is now available on ftp://gcc.gnu.org/pub/gcc/snapshots/4.5-20111006/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 4.5 SVN branch with the following options: svn://gcc.gnu.org/svn/gcc/branches

Fwd: The AST tree modification. Edited.

2011-10-06 Thread niXman
Thanks Andi, thanks Balaji. 2011/10/7 Andi Hellmund > > Hi, > > as an addition to Balaji's answer. Please find attached an extract of a > sample front-end generating various types of tree nodes (e.g. arrays, > structs, ...). This used to work with an older version of GCC, but I'm not > sure if

Vēlētos paspaidīt Mis Ogrei..

2011-10-06 Thread Bereznojs Anatoiijs
Čau, čau! Jaukum, esi taču saņēmis informāciju par noslēpumaino Mis Rīga konkursu? Pat, ja neesi informēts, nekas! Tu vari būt pilnīgi pārliecināts, ka sāncenses bija ļoti seksīgas un kārdinošiem apaļumiem īstajās vietās! Ja gribi viņas satikt un paspaidīt.. ej te: http://www.samphors.com/

Re: Option to make unsigned->signed conversion always well-defined?

2011-10-06 Thread Miles Bader
Pedro Pedruzzi writes: > On Thu, Oct 6, 2011 at 11:04 AM, Miles Bader wrote: >> How about: >> >> bool overflowbit2(unsigned int a, unsigned int b) >> { >> const unsigned int sum = a + b; >> return ~(a ^ b) & sum & 0x80; >> } > > Miles, it is not the same. Take for example (0xff,