WITH node
SELECT
FROM
var: Var => RETURN [ProposedModeForVar[var, lhs, wrongSize, usedSz]];
apply: ApplyNode => {
--bits are defined even if wrongSize!
IF lhs THEN CantHappen;
IF apply.handler=
NIL
THEN {
WITH apply.proc
SELECT
FROM
op: OperNode => {
WITH op.oper
SELECT
FROM
arithOp: ArithOper => IF arithOp.class.precision=C2CTarget.bitsPerDoubleWord AND arithOp.class.kind=real THEN RETURN [Make[assUnits]];
ENDCASE => {}
};
ENDCASE => {}
};
IF node.bits>bPW
THEN {
--Occurs with ALL constructor and double precision
IF (node.bits
MOD bPW)=0
THEN RETURN [Make[plain]]
ELSE RETURN [Make[favoriteBitAMode]]
};
IF node.bits=0 THEN RETURN [Make[skip]];
RETURN [Make[value]];
};
const: ConstNode => {
--bits are defined even if wrongSize!
IF lhs OR node.bits=0 THEN CantHappen;
IF node.bits>bPW
OR const.kind=numLiteral
THEN RETURN [Make[plain]] --we will make a template
ELSE RETURN [Make[value]];
};
assign: AssignNode => {
--bits are defined independent of wrongSize!
--too simple ??
m: Mode;
IF lhs THEN CantHappen;
IF assign.lhs.bits<=bPW THEN RETURN [Make[value]]; --too simple !!
mode ¬ ProposedModeForVar[assign.lhs, TRUE, FALSE, assign.lhs.bits];
SELECT GetAMode[mode]
FROM
plain => {
m ¬ ProposedMode[assign.rhs, FALSE, FALSE, assign.rhs.bits];
SELECT GetAMode[m]
FROM
plain => {FreeMode[m]; RETURN [Make[plain]]};
ENDCASE => NULL;
};
ENDCASE => NULL;
FreeMode[mode];
RETURN [Make[favoriteBitAMode]];
};
block: BlockNode => RETURN [GetListAddrMode[block.nodes, lhs, wrongSize, usedSz]];
source: SourceNode => RETURN [GetListAddrMode[source.nodes, lhs, wrongSize, usedSz]];
decl: DeclNode => RETURN [ProposedModeForVar[decl.var, FalseLHS[lhs], FALSE, usedSz]];
enable: EnableNode => RETURN [GetListAddrMode[enable.scope, FalseLHS[lhs], FALSE, usedSz]];
cond: CondNode => {
--eg: h ← IF x THEN 9 ELSE 11;
RETURN GetCondAddrMode[cond, FalseLHS[lhs], wrongSize, usedSz];
};
oper: OperNode => {
[] ¬ FalseLHS[lhs];
RETURN [Make[value]];
};
machineCode: MachineCodeNode => {
[] ¬ FalseLHS[lhs];
RETURN [Make[value]];
};
module: ModuleNode => CantHappen;
goto: GotoNode => CantHappen;
lab: LabelNode => RETURN [ProposedMode[lab.label.node, lhs, wrongSize, usedSz]];
lambda: LambdaNode => CantHappen;
return: ReturnNode => {
IF lhs THEN CantHappen;
RETURN [Make[value]];
};
comment: CommentNode => CantHappen;
ENDCASE => {
IF node#NIL THEN CaseMissing;
IF lhs
OR usedSz>bPW
OR wrongSize
THEN RETURN [Make[plain]]
ELSE RETURN [Make[value]]
};