Format3TiccRs2:
TYPE ~
MACHINE
DEPENDENT
RECORD [
op (0:0..1): Op ¬,
pad1 (0:2..2): Ignored1 ¬ Ignored1.ignored,
cond (0:3..6): Cond ¬,
op3 (0:7..12): Op3 ¬,
rs1MS (0:13..15): RegisterMS ¬,
rs1LS (0:16..17): RegisterLS ¬,
i (0:18..18): I ¬ I.useRS2,
pad2 (0:19..26): Ignored8 ¬ Ignored8.ignored,
rs2 (0:27..31): Register ¬
];
Subsidiary types
Op:
TYPE ~
MACHINE
DEPENDENT {
branch (00B), call (01B), other2 (02B), other3 (03B)
};
Op2:
TYPE ~
MACHINE
DEPENDENT {
unimplemented0 (00B), bicc (02B), sethi (04B), fbfcc (06B), cbccc (07B)
};
Op3:
TYPE ~
MACHINE
DEPENDENT {
use Op10Op3 and Op11Op3 to get values for fields of this type. Sigh.
first (000B), last (077B)
};
Op10Op3:
TYPE ~
MACHINE
DEPENDENT {
Fill this in as you need it.
add (000B), or (002B), sub (004B),
jmpl (070B), rett (071B),
save (074B), restore (075B),
unimplemented77 (077B)
Op11Op3:
TYPE ~
MACHINE
DEPENDENT {
Fill this in as you need it.
ld (000B), st (004B), unimplemented77 (077B)
Register:
TYPE ~
MACHINE
DEPENDENT {
global0 (0), global1, global2, global3, global4, global5, global6, global7,
out0 (8), out1, out2, out3, out4, out5, out6, out7,
local0 (16), local1, local2, local3, local4, local5, local6, local7,
in0 (24), in1, in2, in3, in4, in5, in6, in7
};
stackPointer: Register ~ Register.out6;
stackPointerOffset:
NAT ~ 16 *
BYTES[TargetArchitecture.Contents];
When you use sp-relative addressing, you have to avoid the 16 word area at the bottom of the stack in which the system saves in and local registers whenever it wants to.
stackAllocationForCallee:
NAT ~ 8 *
BYTES[TargetArchitecture.Contents];
If you might be changing a leaf frame to a (non-aggregate-returning) caller frame, you have to allocate at least this much space, into which the callee may store register arguments.
stackAllocationUnit:
NAT ~ 2 *
BYTES[TargetArchitecture.Contents];
The stack has to be double-word aligned.
framePointer: Register ~ Register.in6;
returnAddress: Register ~ Register.in7;
FloatingRegister:
TYPE ~
MACHINE
DEPENDENT {
float0 (0), float1, float2, float3, float4, float5, float6, float7,
float8, float9, float10, float11, float12, float13, float14, float15,
float16, float17, float18, float19, float20, float21, float22, float23,
float24, float25, float26, float27, float28, float29, float30, float31
};
RegisterClass:
TYPE ~
MACHINE
DEPENDENT {
none (LOOPHOLE[TargetArchitecture.RegisterClass.none]),
globals, globalsAndIns, globalsInsAndFloats, globalsInsFloatsOutsAndLocals,
nextAvailable,
all (LOOPHOLE[TargetArchitecture.RegisterClass.all])
} ¬ nullRegisterClass;
nullRegisterClass: RegisterClass ~ RegisterClass.none;
Annul:
TYPE ~
MACHINE
DEPENDENT {
execute (0), annul (1)
};
Cond:
TYPE ~
MACHINE
DEPENDENT {
never (00H), equal (01H), lessOrEqual (02H), less (03H),
lessOrEqualUnsigned (04H), carrySet (05H), negative (06H), overflowSet (07H),
always (08H), notEqual (09H), greater (0AH), greaterOrEqual (0BH),
greaterUnsigned (0CH), carryClear (0DH), positive (0EH), overflowClear (0FH)
};
In the PrincOps compiler, you can't have enumerations (or even subranges) like this, so we have to do our own, dynamic, type-checking. Sigh.
Disp30:
TYPE ~
INT32;
-- this is not a biased subrange, now!
firstDisp30: Disp30 ~ -536870912;
lastDisp30: Disp30 ~ +536870911;
Disp30: TYPE ~ INT [-536870912..536870911]; -- in Mimosa.
Imm22:
TYPE ~
CARD32;
firstImm22: Imm22 ~ 0;
lastImm22: Imm22 ~ 4194303;
Imm22: TYPE ~ NAT [0..4194303]; -- in Mimosa.
Imm22MS: TYPE ~ CARDINAL [0..63];
Imm22LS: TYPE ~ CARDINAL [0..65535];
Disp22:
TYPE ~
INT32;
-- this is not a biased subrange, now!
firstDisp22: Disp22 ~ -2097152;
lastDisp22: Disp22 ~ +2097151;
Disp22: TYPE ~ INT [-2097152..2097151]; -- in Mimosa.
Simm13:
TYPE ~
INTEGER [-4096..4095];
firstSimm13: Simm13 ~ -4096;
lastSimm13: Simm13 ~ 4095;
Imm10:
TYPE ~
CARDINAL [0..1023];
firstImm10: Imm10 ~ 0;
lastImm10: Imm10 ~ 1023;
Types for signed bitfields in instruction records.
These are unbiased types, which is what you want in the instruction fields.
For signed fields, you have to undo the biasing that Mesa put on types.
Unbiased30:
TYPE ~
CARD32;
firstUnbiased30: Unbiased30 ~ 0;
lastUnbiased30: Unbiased30 ~ 1073741823;
Unbiased30MS: TYPE ~ CARDINAL [0..16383];
Unbiased30LS: TYPE ~ CARDINAL [0..65535];
Unbiased30: TYPE ~ MACHINE DEPENDENT {zero (0), (1073741823)}; -- in Mimosa.
Unbiased22:
TYPE ~
CARD32;
firstUnbiased22: Unbiased22 ~ 0;
lastUnbiased22: Unbiased22 ~ 4194303;
Unbiased22: TYPE ~ MACHINE DEPENDENT {zero (0), (4194303)}; -- in Mimosa.
Unbiased22MS: TYPE ~ CARDINAL [0..63];
Unbiased22LS: TYPE ~ CARDINAL [0..65535];
Unbiased13:
TYPE ~
CARDINAL [0..8191];
Unbiased13: TYPE ~ MACHINE DEPENDENT {zero (0), (8191)}; -- in Mimosa.
firstUnbiased13: Unbiased13 ~ 0;
lastUnbiased13: Unbiased13 ~ 8191;
RegisterMS: TYPE ~ CARDINAL [0..7];
RegisterLS: TYPE ~ CARDINAL [0..3];
I:
TYPE ~
MACHINE
DEPENDENT {
useRS2 (0), useSimm13 (1)
};
ASI: TYPE ~ CARDINAL [0..255];
OpF:
TYPE ~
MACHINE
DEPENDENT {
unimplemented000 (000B), unimplemented777 (0777B)
};
Ignored1:
TYPE ~
MACHINE
DEPENDENT {
ignored (0), (1)
} ¬ Ignored1.ignored;
Ignored8:
TYPE ~
MACHINE
DEPENDENT {
ignored (0), (255)
} ¬ Ignored8.ignored;