Modula-2 Reloaded

A Modern Typesafe & Literate Programming Notation

Site Menu

Project

Specification

Implementation

Recommendations

Reference

Needs Updating

Work in Progress

Wastebasket

Wiki Manual

edit SideBar

Spec ATOMIC

ATOMIC

Spec.ATOMIC History

Hide minor edits - Show changes to output

2010-05-24 11:43 by benjk -
Changed lines 3-4 from:
(* Pseudo-module for atomic intrinsics *)
to:
(* Pseudo-module for Atomic Intrinsics *)
Changed lines 8-10 from:
   (* Tests the availability of an intrinsic for a given bitwidth and returns true
      if the intrinsic is available, otherwise false
. bitwidth must be a constant. *)
to:
(* Returns TRUE if the given intrinsic is available for the given bitwidth,
  otherwise FALSE. The value of bitwidth must be a compile time expression
.*)
Changed lines 12-17 from:
   (* Atomically swaps x and y. Type must be an 8, 16, 32 or 64 bit type *)

PROCEDURE CAS( VAR x : expectedValue, y : <Type> ) : Type;
  (* Atomically compares x and expectedValue, if they are equal, swaps x and y
.
     Always returns original value of x. Type must be an 8, 16, 32 or 64 bit type *)
to:
(* Atomically swaps x and y. Type must be an 8, 16, 32 or 64 bit type. *)

PROCEDURE CAS( VAR expectedValue, y : <Type> ) : Type;
(* Atomically compares x and expectedValue, if they are equal, swaps x and y.
  Returns original value of x
. Type must be an 8, 16, 32 or 64 bit type. *)
Changed lines 19-20 from:
   (* Atomically increments x by y. Type must be an 8, 16, 32 or 64 bit type *)
to:
(* Atomically increments x by y. Type must be an 8, 16, 32 or 64 bit type. *)
Changed lines 22-38 from:
   (* Atomically decrements x by y. Type must be an 8, 16, 32 or 64 bit type *)

PROCEDURE BWAND( VAR x : <Type>; y : <Type> ) : <Type>;
  (* Atomically performs bitwise AND of x and y, stores the result in x.
      Always returns the original value of
x. Type must be an 8, 16, 32 or 64 bit type *)

PROCEDURE BWNAND( VAR x : <Type>; y : <Type> ) : <
Type>;
  (* Atomically performs bitwise NAND of x and y, stores the result in x.
 
     Always returns the original value of x. Type must be an 8, 16, 32 or 64 bit type *)

PROCEDURE BWOR( VAR x : <Type>; y : <Type>
) : <Type>;
 
  (* Atomically performs bitwise OR of x and y, stores the result in x.
      Always returns the original value of x. Type must be an 8, 16, 32 or 64 bit type *)

PROCEDURE BWXOR( VAR x : <Type>; y : <Type> ) : <Type>;
  (* Atomically performs bitwise XOR of x and y, stores the result in x.
      Always returns the original value of x. Type must be an 8, 16, 32 or 64 bit type
*)
to:
(* Atomically decrements x by y. Type must be an 8, 16, 32 or 64 bit type. *)

PROCEDURE BWAND( VAR x : <Type>; y : <Type> );
(* Atomically performs bitwise AND of x and y, and passes the result in x.
  Type must be an 8, 16, 32 or 64 bit type. *)

PROCEDURE BWNAND( VAR
x : <Type>; y : <Type> );
(* Atomically performs bitwise NAND of x and y, and passes the result in x.
  Type must be an 8, 16, 32 or 64 bit type. *)

PROCEDURE BWOR( VAR x : <Type>; y : <Type> );
(* Atomically performs bitwise OR of x and y, and passes the result in x.
  Type must be an 8, 16, 32 or 64 bit type. *
)

PROCEDURE BWXOR( VAR x : <Type>; y : <Type> );
(* Atomically performs bitwise XOR of x and y, and passes the result in x.
  Type must be an 8, 16, 32 or 64 bit type.
*)