|
That generalization is highly dependent on the architecture of the processor. The generalization is mostly based on the behavior of intel 8086-family chips that only had 16-bit numeric registers. Doing eight-bit arithmetic with a 16 bit register required a couple extra ops to handle overflow. This was in a time when those extra ops took time. With current Power technology, all that is parallelized in multiple processor pipes optimized by advanced compilers and I doubt if there's any performance impact at all.
-----Original Message-----
From:midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Tim Bronski
Sent: Tuesday, March 26, 2013 10:13 AM
To: Midrange Systems Technical Discussion
Subject: Re: One byte integer
Does anyone know what the performance considerations might be on using a char instead of an int? I know it's a generalization but usually int processing is faster than shorts and chars. Not sure if this has any application here, just curious.
In 3/26/2013 3:27 PM, Luis Rodriguez wrote:
> Rob,--
>
> I believe that the OP stated somewhere that he needed to store a
> number between 0 and 100. An one-byte integer field could allow
> between -127 and
> 128 if signed and between 0 and 255 if unsigned.
>
> Regards,
> Luis Rodriguez
> IBM Certified Systems Expert - eServer i5 iSeries
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.