From: David F. B. <df...@wa...> - 2002-01-16 00:54:53
|
What do you plan to use this for? We already emit CAS for certain things, like locking primitives and for pointer updates in the concurrent collector. See VM_Magic.prepare() and VM_Magic.attempt(). However, there may be a better general-purpose solution. david David Hovemeyer wrote: > Hi everyone, > > I want to modify Jikes RVM's optimizing compiler to emit code for > atomic compare-and-swap (CAS) in certain circumstances. Since I don't > know much about the internals of RVM, I have some beginner questions. > > Should CAS should be an HIR or LIR instruction? > > CAS needs at least three operands: memory location, expected value, > updated value. Will I need to define a new instruction format for > this? > > Does it also need a guard operand, for the result of the null check on > the memory location? (What exactly are the guard operands used for?) > > What is the procedure for adding a new IR instruction? (Which files > need to be changed.) > > How/where is the machine code actually emitted for IR instructions? > > What configuration should I use if I don't want the optimizing compiler > compiled into the boot image? I'm assuming that it would be better to > load it at runtime, to avoid having to make a new boot image each time > I modify the opt compiler. Currently I'm using OptOptSemispace. > > Initially, I would like to get this working with PowerPC Linux, using > the lwarx and stwcx instructions. Later I might want to implement it > on x86 using the locked cmpxchg instruction. > > Any help would be greatly appreciated. > > Thanks, > Dave > _______________________________________________ > Jikesrvm-researchers mailing list > Jik...@ww... > http://www-124.ibm.com/developerworks/oss/mailman/listinfo/jikesrvm-researchers |