This is one area where I prefer c++ over c. SEH is easier to deal with there with their exception throwing.
In c (I'm a newbie too) I've used 4 methods that I don't really like too much so I'm all...
Type: Posts; User: rafe
This is one area where I prefer c++ over c. SEH is easier to deal with there with their exception throwing.
In c (I'm a newbie too) I've used 4 methods that I don't really like too much so I'm all...
No point in arguing any more... Some people drank the cool-aid and some people didn't.:p
1) choose a good algorithm
2) make the code work while keeping it readable/maintainable
3) tune it by making it faster or smaller or whatever in the tight spots. One should consider this step all...
It's a matter of opinion as to which is more readable. In the contrived examples given you don't see what can happen when you nest nest nest... ad nauseum. Over nesting also makes things very hard to...
[flame=on]
very old debate. Dijkstra, Hoare, & Wirth trot this old nonsense out every few years. And It's spouted by academics who tire of teaching comp sci 101 students the art (yes art!) of...
The section in the doc just before the one we were using:
http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Explicit-Reg-Vars.html#Explicit%20Reg%20Var
Maybe we shouln't go down this rabbit hole just yet...
Sargnagel,
Would you please do me the favor of letting me know if you get any speedup using these functions? Or how much into register manipulations you had to get to realize the speedup?
This...
Grrr! this was a bear to figure out! Short answer: YOU didn't do anything wrong, this is a gcc snafu.
Apparently GCC doesn't always align vars in main BUT is does align them in other functions....
You're welcome. && Just to drive the point home to others not as motivated as you.
Now I'm going to look at how to get the mmx registers worked the way I want. I'm not allowed to use assembly...
Useful info! After some playing around...
compiled with "gcc -mmmx myprog.c"
#include <stdlib.h>
typedef int di __attribute__ ((mode(DI)));
union {
di xx;
Well, I'm always looking for a way to be a lazier programer (-; So if you have a particular suggestion I'll give it a whorl.
BTW: Linux/gcc and the command line is:
gcc -lm -o calc calc.c &&...
Got it. Thanks to both. Yea, it's big struct... so much for being lazy.
FYI "ulimit -s" gives "unlimited". But your explainations seem more on target than this bash nonsense.
Goggle gave me this...
http://docs.freebsd.org/mail/archive/2001/freebsd-audit/20011014.freebsd-audit.html
Not a regular libc function yet.
More experiments. Curiouser...
I can move this inside the routine & it works
double Mat1[20][20] = { /* Constant values go here */ };
But not...
double Mat[512][20][20];
Which means...
Riddle me this...
Using gcc I have a setup routine that I'm building up. I'm calculating a 3D array of doubles, an array of matrices if you will. If I put the arrays on the stack the program goes...
*sigh* Another very heavy & clumsy api. From personal experience, it works OK; or more to the point it's slow & clunky but fairly solid. Like a diesel Volvo going up hill on a cold day. On the...
Well gdbm is the gnu version. Tho, I guess it's six in one hand... What do you plan to do with the the db?
[Warning: Prefix all of this with IIRC]
The libs have their uses but they're more for...
> Well they will be data aligned for sure -
> meaning you can store a data type with the
> most restrictive type (usually a double) at
> the address returned to you.
Yup, my tests confirm that I...
A few more source code tweaks & the user time is now at 0m31.610s. I'm only posting this because those same tweaks with the -mcpu vs -march switch were actually *slowing down* the times. This was...
Nix that! Whoa! User time dropped from 0m48.910s to 0m37.400s.
Great catch!:D :D :D :D :D
No. While reading the man pages on gcc I read:
So, your hypothesis is that -mtune could have a negative effect on speed? I didn't think of that & seeing how the other options can have a negative...
make that... http://linuxassembly.org/
Also look at the on-line book "Advanced Linux Programming", a PDF download. Chapter 9 covers gcc inline assembly particulars. Not in a lot of depth but enuf...
I know that program optimization can be fickle. But I'm trying to learn what I can about gcc switches & I figured I'd share my findings. It is odd to see how many of the switches slow things down,...
A few extra ticks thanks. Given how heavily this program will be hit in the next few months the difference *IS* significant.
When I use "-O3 -fomit-frame-pointer" the times cluster near:
real ...
Thanks! I'm currently using gcc 3.2 so it has the Athlon switches. I'll experiment & time against my prog.