Fix memory transaction primops for 64bit:
The proper way to write (StgBool) true and false in Cmm is 1 :: CInt and
0 :: CInt, respectively.
This is because StgBool is defined as int,
which is often 32bit on 64bit platforms, while Cmm integer literals without
type annotations are 64bit words on 64bit platforms.
So everyone please remember: int and StgBool are not always the same size as
StgInt, StgWord and W_.
/* Previous attempt is no longer valid: try again */ \
"ptr" trec = foreign "C" stmStartTransaction(NO_TREC "ptr"); \
StgTSO_trec(CurrentTSO) = trec; \
/* Previous attempt is no longer valid: try again */ \
"ptr" trec = foreign "C" stmStartTransaction(NO_TREC "ptr"); \
StgTSO_trec(CurrentTSO) = trec; \
- StgAtomicallyFrame_waiting(frame) = 0; /* false; */ \
+ StgAtomicallyFrame_waiting(frame) = 0 :: CInt; /* false; */ \
R1 = StgAtomicallyFrame_code(frame); \
Sp_adj(-1); \
jump RET_LBL(stg_ap_v); \
R1 = StgAtomicallyFrame_code(frame); \
Sp_adj(-1); \
jump RET_LBL(stg_ap_v); \
frame = Sp;
SET_HDR(frame,stg_atomically_frame_info,CCCS);
frame = Sp;
SET_HDR(frame,stg_atomically_frame_info,CCCS);
- StgAtomicallyFrame_waiting(frame) = 0; // False
+ StgAtomicallyFrame_waiting(frame) = 0 :: CInt; // False
StgAtomicallyFrame_code(frame) = R1;
/* Start the memory transcation */
StgAtomicallyFrame_code(frame) = R1;
/* Start the memory transcation */
frame = Sp;
SET_HDR(frame, stg_catch_retry_frame_info, CCCS);
frame = Sp;
SET_HDR(frame, stg_catch_retry_frame_info, CCCS);
- StgCatchRetryFrame_running_alt_code(frame) = 0; // false;
+ StgCatchRetryFrame_running_alt_code(frame) = 0 :: CInt; // false;
StgCatchRetryFrame_first_code(frame) = R1;
StgCatchRetryFrame_alt_code(frame) = R2;
StgCatchRetryFrame_first_code_trec(frame) = new_trec;
StgCatchRetryFrame_first_code(frame) = R1;
StgCatchRetryFrame_alt_code(frame) = R2;
StgCatchRetryFrame_first_code_trec(frame) = new_trec;
// Retry in the first code: try the alternative
"ptr" trec = foreign "C" stmStartTransaction(outer "ptr");
StgTSO_trec(CurrentTSO) = trec;
// Retry in the first code: try the alternative
"ptr" trec = foreign "C" stmStartTransaction(outer "ptr");
StgTSO_trec(CurrentTSO) = trec;
- StgCatchRetryFrame_running_alt_code(frame) = 1; // true;
+ StgCatchRetryFrame_running_alt_code(frame) = 1 :: CInt; // true;
R1 = StgCatchRetryFrame_alt_code(frame);
Sp_adj(-1);
jump RET_LBL(stg_ap_v);
R1 = StgCatchRetryFrame_alt_code(frame);
Sp_adj(-1);
jump RET_LBL(stg_ap_v);
// Merge failed: we musn't propagate the retry. Try both paths again.
"ptr" trec = foreign "C" stmStartTransaction(outer "ptr");
StgCatchRetryFrame_first_code_trec(frame) = trec;
// Merge failed: we musn't propagate the retry. Try both paths again.
"ptr" trec = foreign "C" stmStartTransaction(outer "ptr");
StgCatchRetryFrame_first_code_trec(frame) = trec;
- StgCatchRetryFrame_running_alt_code(frame) = 0; // false;
+ StgCatchRetryFrame_running_alt_code(frame) = 0 :: CInt; // false;
StgTSO_trec(CurrentTSO) = trec;
R1 = StgCatchRetryFrame_first_code(frame);
Sp_adj(-1);
StgTSO_trec(CurrentTSO) = trec;
R1 = StgCatchRetryFrame_first_code(frame);
Sp_adj(-1);
r = foreign "C" stmWait(CurrentTSO "ptr", trec "ptr");
if (r) {
// Transaction was valid: stmWait put us on the TVars' queues, we now block
r = foreign "C" stmWait(CurrentTSO "ptr", trec "ptr");
if (r) {
// Transaction was valid: stmWait put us on the TVars' queues, we now block
- StgAtomicallyFrame_waiting(frame) = 1; // true
+ StgAtomicallyFrame_waiting(frame) = 1 :: CInt; // true
Sp = frame;
jump stg_block_noregs;
} else {
Sp = frame;
jump stg_block_noregs;
} else {