Numbers obviously.
--
Veety
True story. If I wasn't on a phone i'd elaborate more.
On Wednesday 25 of April 2012 15:32:06 erik quanstrom wrote:
> also, in case you missed it sizeof(int)==sizeof(long)==4 on both 32
> and 64 bit plan 9, so recompiled programs won't get bigger integers
> just for the recompiling.
pardon silly question, but... why, on 64bit machine, P9 uses 32bit ints and
longs?
my impression is, int was supposed to match machine's preferred (best
performance etc.) integeral datatype, and long was supposed to be enough to
hold a pointer? (i.e., sizeof(long) >= sizeof(void*))
if it's performance you're worried about, for programs that don't care about width, i'd expect 32 bits at leastto match performance with 64 bits (if there's a measurable difference). for one thing, cache lines will containmore values, and several will be fetched at once when cache lines are filled.
> Yes, the u{...}int names are important. Those "different names" arethe int_least_* names appear to me to be completely wasted, given
> normally for other (though obviously related) purposes (conceptually
> int_exact_*), and the int_least_* and int_fast_* names, usually are built
this is how the normal types are defined and that you couldn't depend
on the extra bits.
also, how do you debug code written like this?
one complete test for each possible definition of int_least_*?
of course, that leads to the question, is that set known?
one also wonders about int_fast_* as well. fast /for what/ exactly?
it seems that all this is in respose to the fact that the c-std version
of u32int is not required.
(the names are somewhat offensive to
good taste, so i refer to them as one does carlin's list, by suggestion.)
rather than fix that issue, layering on another set of types was the
solution. really?
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n868.htm :
“ It can also be argued that programmers that use the 'intN_t' more than
likely really meant to use the 'int_leastN_t' types. Such programmers
probably want a type with a guaranteed number of bits rather than an
exact number of bits.
It can be argued further that use of the 'intN_t' names is not portable
because they may not exist in all implementations. (An implementation
is not required to provide these types.)
unfortunately, there are still programmers who use the definition
more complicated ≡ more better. evidently believing in the
transitive nature of "more" over false premises.
On Monday 07 of May 2012 11:27:29 Charles Forsyth wrote:fwiw, back in my uni days we were using some old 64bit Solaris on Sun's
> The MIPS, PowerPC and SPARC all grew to 64 bits from 32 bits, so 32 bit
> quantities
> (and usually but not always 16 bit and 8 bit quantities) have suitable
> instructions to fetch them.
UltraSparcs, and those had sizeof(int) == 8. i remember distinctly how my lame
programs (developed on x86 and assuming sizeof(int) == 4) tripped on it.
can't recall exact versions, but the CPUs were somewhere around 400MHz or so,
and GCC was the compiler of choice.
...
processor bw >> memory bw ==> smaller integers faster
memory bw >> processor bw ==> natural integers faster
(this is yet another reason that int_fast* are a half-baked idea.
how does the compiler know this relation for the target machine
ahead of time?) ...