Hi Brad, thanks. I think I modified the compiler, so I can insert my own code at the beginning/end of atomic statements. Just to be sure:
On Tue, Mar 25, 2014 at 2:37 PM, Brad Chamberlain <[email protected]> wrote: > Hi Jens -- > > Without knowing much about the TSX interface, here's a very high-level > potential sketch: > > * write some C macros that wrap the start/end transaction instructions > and look like function calls syntactically. > e.g.: > #define CHPL_TSX_START (<whatever magic starts the transaction via > C>) > #define CHPL_TSX_STOP(<whatever magic stops the transaction via C>) > It wasn't working with macros, so I used static inline functions. Should I expect any trouble or is this fine? > * in the parser, insert "calls" to these external routines as the first > and last statements of the block created when parsing an atomic block (in > buildAtomicStmt()). > > e.g.: > STMT* atomicBlock = new BlockStmt(stmt); > atomicBlock->insertAtHead(new CallExpr("CHPL_TSX_START")); > atomicBlock->insertAtTail(new CallExpr("CHPL_TSX_STOP")); > I used BlockStmt* instead of STMT*, but I guess that is fine? BlockStmt* atomicBlock = buildChapelStmt(new BlockStmt(stmt)); atomicBlock->insertAtHead(new CallExpr("CHPL_TSX_START")); atomicBlock->insertAtTail(new CallExpr("CHPL_TSX_STOP")); - Jens
------------------------------------------------------------------------------
_______________________________________________ Chapel-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/chapel-developers
