[erlang-questions] Erlang math libraries

Roger Larsson roger.larsson@REDACTED
Wed May 16 18:36:23 CEST 2007


On Wednesday 16 May 2007 12:01, Matthias Lang wrote:
> (1) I.e. if two of those 8 instructions write to the same register,
>     that is your problem, not the CPUs. In practice, the C compiler
>     takes care of that, but it sure makes single-stepping the machine
>     code interesting.

It is even worse. You may have several results in different pipeline stages to
the same register. This results in really bad interrupt latency since you can
not take any interrupts in a tight loop! The C compiler handles that too...
But to get maximum performance you need to annotate the code with pragmas -
expect errornous results if you get the annotations wrong!

Suppose you have a for loop in your code. To get maximum performance you
need to annotate it to tell that there will be at least 100 loops, but not 
more than 1000, in steps of eight. (At least that was needed when I used it
some years ago, the analyzer might have become better)

/RogerL




More information about the erlang-questions mailing list