I've tried to make Delphi a little faster for a routine which is often called (very often):
const aBit: Cardinal;
const aSwitch: Boolean;
var aMarker: LongWord );
if aSwitch then
aMarker := aMarker or aBit
aMarker := aMarker and not aBit;
Delphi (D7) codes that 'likely' performant, if one specifies register as a compiler hint. The compiler is a 'little' dumb and puts all the passed registers at first on the stack.
This little peace of code is called very often so I've made a more optimzed version of it:
mov eax, &aMarker // Load the address of aMarker into EAX
cmp aSwitch, $00
or [eax], edx
and [eax], edx@End
Has anyone a better solution? I'm not so familar with the mmx commands, may be there is a faster solution?