From: lauras AT softhome DOT net Message-ID: <20010204104132.7148.qmail@softhome.net> References: In-Reply-To: To: Eli Zaretskii Cc: djgpp-workers AT delorie DOT com Subject: Re: stdint.h Date: Sun, 04 Feb 2001 10:41:32 GMT Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Sender: lauras AT softhome DOT net Reply-To: djgpp-workers AT delorie DOT com Eli Zaretskii writes: > However, I didn't find any evidence that an int is faster than a char. > Can you provide such an evidence, e.g., by looking at the code produced > by gcc 2.9X and counting cycles? I tried. I was wrong - the difference between two versions is very little. Here is my "benchmark": int main(void) { unsigned char x, y, z, t, u, v; for (x = 0; x < 200; x++) for (y = 0; y < 200; y++) for (u = 0; u < 200; u++) for (v = 0; v < 200; v++) { z = x * y; t = z - x / y; z = t + u; t = z - u; } return 0; } Replace 'unsigned char' with 'unsigned int' for int version. > > > +typedef signed int int_fast16_t; > > > +typedef unsigned int uint_fast16_t; > > > > Likewise there. > > Well, these _are_ 32-bit int's, aren't they? ;-) Ooops. I swear I saw 'short int' there :-) Laurynas