develooper Front page | perl.perl5.porters | Postings from March 2003

Re: [PATCH] glibc _moddi3

Thread Previous | Thread Next
From:
Tels
Date:
March 2, 2003 20:32
Subject:
Re: [PATCH] glibc _moddi3
Message ID:
perl.perl5.porters-72668@nntp.perl.org
-----BEGIN PGP SIGNED MESSAGE-----

Moin,

On 03-Mar-03 Enache Adrian carved into stone:
> On Sun, Mar 02, 2003 at 06:01:40PM +0100, Tels wrote:
>> Here are two test c files, both "compiled" with gcc -s -O3 and I show
>> only
>> the assembly output for the main functions here:
> 
> Maybe my message was bad formulated. I didn't say to keep the
> if (..) ..; code - silly compilers doesn't seem to grok it.
> Maybe the thing everybody wants is:
> 
> in .h
>#define ABS(a) ((a) < 0 ? -(a) : (a))
>       /* beware: it evaluates 'a' twice */


> 
> in .c
> left % ABS(right)
> 
> But, please please don't use the wicked abs() function.
> It's not an operator.
> 
> It will always punch its argument into an int, should it
> be long long, long, unsigned, etc. GCC will sometimes
> inline it and sometimes not.

Ah, than for the warning. I must admit my C and compiler and assembler
knowledge is getting quite rusty...

> You'll be better off if you _never_ use it :-)

I'll remember this :)

>> Oh, one more thought: In the code in question, what are "right" and
>> "left"? ints? longs? or IVs?
> 
> They are IVs. This means they could be 64-bit on a 32-bit platform.
> (If you configured with -Duse64bitint).

Ah, okay. Thanx again.

Best wishes,

Tels

- -- 
 Signed on Mon Mar  3 05:31:36 2003 with http://bloodgate.com/tels.asc

 perl -MDev::Bollocks -le'print Dev::Bollocks->rand()'
 authoritatively iterate B2B technologies

 http://www.notcpa.org/          You have the freedom to run any code. Yet.
 http://bloodgate.com/perl       My current Perl projects

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.

iQEVAwUBPmLaqHcLPEOTuEwVAQEL1gf8DZRLu+I+YOukh95mPpPnp1OFlgTWF9eF
VNZJ+WdhwROaJgmRZrDTzNawtc0qX+/si1py5gV+gps3f7ekTPBpF4GRNAQMHqcO
puj61qLGlv37zuw7mkW1etKW9BmFy77P1YZ5/jDNDkFp44eRmDSzPy+37nD7PW8p
yaRYs6ykMssj+F3YiEt/zpxpgcQ2WWvQ0xUeS0oDyjBUy6d8RXA+w17O/7LRDwNh
lXraiMoTqLnS/U24ab5VQbwF+zmrEnO0pZvtjHmDqaTrkhaM/E5UYoXEElBxHTor
z6Ho1nm/UIfSBJcUu7OEV5QCZdcQdOTCCPcwaE1yge+sBYsVnucPhQ==
=wr9q
-----END PGP SIGNATURE-----

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About