--file PeepholeDefs.mesa  edited by Sweet March 9, 1979  4:29 PM

DIRECTORY
  AltoDefs: FROM "altodefs" USING [BYTE],
  CodeDefs: FROM "codedefs" USING [CCIndex, CodeCCIndex, JumpCCIndex],
  ControlDefs: FROM "controldefs" USING [FieldDescriptor],
  Table: FROM "table" USING [Notifier];

PeepholeDefs: DEFINITIONS =
  BEGIN

  PeepState: TYPE = RECORD[
    c: CodeDefs.CodeCCIndex,
    bP, cP: ARRAY [1..3] OF WORD,
    b: CodeDefs.CodeCCIndex,
    bInst: AltoDefs.BYTE,
    bMin: BOOLEAN,
    aP: ARRAY [1..3] OF WORD,
    cInst: AltoDefs.BYTE,
    cMin: BOOLEAN,
    a: CodeDefs.CodeCCIndex,
    aInst: AltoDefs.BYTE,
    aMin: BOOLEAN];

  JumpPeepState: TYPE = RECORD[
    c: CodeDefs.JumpCCIndex,
    bP, cP: ARRAY [1..3] OF WORD,
    bInst: AltoDefs.BYTE,
    bMin: BOOLEAN,
    b: CodeDefs.CodeCCIndex,
    cInst: AltoDefs.BYTE,
    cMin: BOOLEAN];

  SetRealInst: PROCEDURE [BOOLEAN];
  SetSourceIndex: PROCEDURE [CARDINAL];
  InitParametersABC: PROCEDURE [p: POINTER TO PeepState];
  InitParametersBC: PROCEDURE [p: POINTER TO PeepState];
  InitParametersC: PROCEDURE [p: POINTER TO PeepState];
  InitJParametersBC: PROCEDURE [p: POINTER TO JumpPeepState];
  SlidePeepState2: PROCEDURE [p: POINTER TO PeepState, ci: CodeDefs.CodeCCIndex];
  SlidePeepState1: PROCEDURE [p: POINTER TO PeepState, ci: CodeDefs.CodeCCIndex];
  PeepZ: PROCEDURE [start: CodeDefs.CodeCCIndex];
  HalfByteLocal: PROCEDURE [c: CodeDefs.CCIndex] RETURNS [BOOLEAN];
  LoadInst: PROCEDURE [c: CodeDefs.CCIndex] RETURNS [BOOLEAN];
  PackPair: PROCEDURE [l,r: [0..16)] RETURNS [w: WORD];
  UnpackPair: PROCEDURE [w: WORD] RETURNS [l,r: [0..16)];
  UnpackFD: PROCEDURE [d: ControlDefs.FieldDescriptor] RETURNS [p,s: CARDINAL];
  MC0: PROCEDURE [i: AltoDefs.BYTE, minimal: BOOLEAN];
  Delete2: PROCEDURE [a,b: CodeDefs.CCIndex];
  Delete3: PROCEDURE [a,b,c: CodeDefs.CCIndex];
  PeepholeZNotify: Table.Notifier;
  PeepholeUNotify: Table.Notifier;
  RemoveThisPop: PROCEDURE [ci: CodeDefs.CCIndex] RETURNS [didThisTime: BOOLEAN];

END.