! rs6p422.i Dec94 adapted for a C backend ! rs6p420.i Jun94 Support for longints added ! Changes 16Nov93 to use pushbytes for string values ! ALSO TO CONSTRUCT param descriptor from reversed lists ! Changes 20sep93 to allow tempspace to be allocated in ! prologue and epilogue rts.(For saveing GOT/TOC ) vsn p420.3 ! Changes 10June93 to byteswop string length in initown ! Changes 4Jan93 to use Enextproc2 ! Changes 3Mar92 to use MVW for aligned record copies ! ! Changes to count use of labels and call EfrLabel for short !forward jumps ! ! Revisions to 22Feb changes to flag bytes as unsigned ints and hence ! to correct conversion code. 26Nov91 ! Changes 22Feb90 to pass types to the ecode generator Vsn 5 ! ! Changes to reduce confusion over dummy parameter pushed for ! alignment purposes (Mostly but not entirely in PARDESLIST ! PDS nov 89 ! ! changes applied for risc development retrofitted (GEM 5/10/89) ! ! Warning this module has the revised triples spec. ! ! In first attempt at Triple Imp considerable use was made of constant operands ! to pass information from Pass2 to GEN. Although for specialised operations like ! passing Labels this still applies, this adhocery has caused problems with arrays ! and pointers particularly in mapped records. The operands for four triples ! have thus been redefined in a more standard way. ! ! GETPTR X1 is now (ptype of passed)<<16! DIMENSION ! Opnd2 is either a 32 bit const with the size (ACC) as value or ! the ptr or arrayhead as normal operand. ! ! VMY X1 is now dim<<28!maxdim<<24!array name(where known) ! Opnd2 is either a 32 bit const with DV offset into const area or ! the arrayhead as a standard operand ! ! AINDX X1 is ELSIZE<<20 !spare ! Opnd2 is arrayhead as standard operand ! NOTE:- The Operands have been swopped for consistency with norm. ! ! BADJ X1 is arrayptype<<16!no of Dimensions (latter in case of backward dvs) ! Opnd2 exactly as for VMY ! %include "hostcodes.inc" %CONST %INTEGER HOST=DRS %CONST %INTEGER TARGET=PENTIUM %conststring(1) assemblerprefix=";" %constinteger CGinC=no ! Copyright (c) 1987 Edinburgh Portable Compilers Ltd. All Rights Reserved. ! !************************************************************************ !* * !* G.E.Millard * !* ECODES28 09/2/88 * !* * !************************************************************************ ! {00} %constinteger HALT = 0 ! !--------------------------------------- generic int operations ------- ! {01} %constinteger IADD = 1 { (Etos-1) + (Etos) => (Etos) } {02} %constinteger ISUB = 2 { (Etos-1) - (Etos) => (Etos) } {03} %constinteger IMULT = 3 { (Etos-1) * (Etos) => (Etos) } {04} %constinteger IDIV = 4 { (Etos-1) / (Etos) => (Etos) } {05} %constinteger INEG = 5 { - (Etos) => (Etos) } {06} %constinteger IABS = 6 { abs( (Etos) ) => (Etos) } {07} %constinteger IREM = 7 { remainder from } { (Etos-1) / (Etos)=> (Etos) } ! {08} %constinteger IAND = 8 { (Etos-1) & (Etos) => (Etos) } {09} %constinteger IOR = 9 { (Etos-1) ! (Etos) => (Etos) } {0A} %constinteger INOT = 10 { ~ (Etos) => (Etos) } {0B} %constinteger IXOR = 11 { (Etos-1) !! (Etos) => (Etos) } {0C} %constinteger ISHLL = 12 { (Etos-1) << (Etos) => (Etos) } {0D} %constinteger ISHRL = 13 { (Etos-1) >> (Etos) => (Etos) } {0E} %constinteger ISHLA = 14 { arithmetic left shift } {0F} %constinteger ISHRA = 15 { arithmetic right shift } ! {10} %constinteger IGT = 16 { if } {11} %constinteger ILT = 17 { (Etos-1) (Etos) } {12} %constinteger IEQ = 18 { then } {13} %constinteger INE = 19 { true (1) => (Etos) } {14} %constinteger IGE = 20 { else } {15} %constinteger ILE = 21 { false (0) => (Etos) } {16} %constinteger BNOT= 22 { (Etos) = BNOT (Etos) 0<->1 } ! {18} %constinteger JIGT = 24 { if } {19} %constinteger JILT = 25 { (Etos-1) (Etos) } {1A} %constinteger JIEQ = 26 { then } {1B} %constinteger JINE = 27 { ->