Hi
is there in FPC a membar instruction, like #StoreLoad macro or smp_mb();and second need instruction is NOOP
Darek

Mailing lists / fpc-devel / 2008-02
6 messages · 2 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi
is there in FPC a membar instruction, like #StoreLoad macro or smp_mb();and second need instruction is NOOP
Darek
Dariusz Mazur wroteHi is there in FPC a membar instruction, like #StoreLoad macro or smp_mb();
ReadBarrier, ReadDependencyBarrier, ReadWriteBarrier, WriteBarrier; in system unit.
and second need instruction is NOOP
Don't know about this one, can't you use a do nothing loop?
Micha
Micha Nelissen pisze:
thx
in spin-lock there is NOOP used, I think that is instruction, that every processor do nothing but not avoid (duration is very small but not zero)
Darek
Dariusz Mazur wrote> Don't know about this one, can't you use a do nothing loop? > in spin-lock there is NOOP used, I think that is instruction, that every processor do nothing but not avoid (duration is very small but not zero)
Why do you use a NOP in a spin-lock?
Micha
Micha Nelissen pisze:
its only exaple form sparc manual, I need (I want to test) it to in my FIFO algo.
form SPARCV9.PDF:
LockWithLDSTUB(lock)
retry:
ldstub [lock],%l0
tst %l0
be out
nop
loop:
ldub [lock],%l0
tst %l0
bne loop
nop
ba,a retry
out:
membar #LoadLoad | #LoadStore
UnLockWithLDSTUB(lock)
membar #StoreStore !RMO and PSO only
membar #LoadStore !RMO only
stub %g0,[lock]
Example 7---Lock and Unlock Using LDSTUB
Darek
Dariusz Mazur wrotebe out nop
Here it's needed because of branch delay slot. You don't need it in pascal code (only when coding custom assembly), compiler will take care of that automatically.
Micha