1 /* -*- mode: hugs-c; -*- */
3 /* --------------------------------------------------------------------------
7 * o INTERNAL_ERROR is never generated by the compiler and usually
8 * indicates as error in the heap.
9 * PANIC is generated by the compiler whenever it tests an "irrefutable"
10 * pattern which fails. If we don't see too many of these, we could
11 * optimise out the redundant test.
13 * o If you add any new instructions, you have to check that each enumeration
14 * has at most 256 entries in it --- some of the lists are very close to
16 * ------------------------------------------------------------------------*/
19 { i_INTERNAL_ERROR /* Instruction 0 raises an internal error */
21 , i_PANIC /* irrefutable pattern match failed! */
42 , i_CONST2 /* 16 bit offsets - ad-hoc fix for general problem */
65 #ifdef PROVIDE_INTEGER
100 #ifdef PROVIDE_STABLE
107 , i_PRIMOP1 /* Primop: next byte is an Primop1 */
108 , i_PRIMOP2 /* Primop: next byte is an Primop2 */
110 , MAX_Instr = i_PRIMOP2
114 { i_INTERNAL_ERROR1 /* Instruction 0 raises an internal error */
116 /* Char# operations */
126 /* Int# operations */
151 /* Int64# operations */
186 /* Word# operations */
213 /* Addr# operations */
223 /* Stateless Addr operations */
227 , i_indexInt64OffAddr
235 , i_indexFloatOffAddr
236 , i_indexDoubleOffAddr
237 #ifdef PROVIDE_STABLE
238 , i_indexStableOffAddr
253 , i_readDoubleOffAddr
254 #ifdef PROVIDE_STABLE
255 , i_readStableOffAddr
261 , i_writeInt64OffAddr
269 , i_writeFloatOffAddr
270 , i_writeDoubleOffAddr
271 #ifdef PROVIDE_STABLE
272 , i_writeStableOffAddr
275 #endif /* PROVIDE_ADDR */
277 #ifdef PROVIDE_INTEGER
278 /* Integer operations */
302 /* Float# operations */
339 #ifdef PROVIDE_INTEGER
345 , i_isDenormalizedFloat
346 , i_isNegativeZeroFloat
349 /* Double# operations */
388 #ifdef PROVIDE_INTEGER
394 , i_isDenormalizedDouble
395 , i_isNegativeZeroDouble
398 /* If you add a new primop to this table, check you don't
399 * overflow the 256 limit. That is MAX_Primop1 <= 255.
400 * Current value (30/10/98) = 0xc8
402 , MAX_Primop1 = i_isIEEEDouble
407 { i_INTERNAL_ERROR2 /* Instruction 0 raises an internal error */
420 /* Prim[Mutable]Array operations */
422 , i_unsafeFreezeArray
431 /* Prim[Mutable]ByteArray operations */
432 , i_sameMutableByteArray
433 , i_unsafeFreezeByteArray
450 /* {write,read,index}IntegerArray not provided */
470 #ifdef PROVIDE_STABLE
476 /* {write,read,index}ForeignObjArray not provided */
478 #endif /* PROVIDE_ARRAY */
480 #ifdef PROVIDE_PTREQUALITY
481 , i_reallyUnsafePtrEquality
483 #ifdef PROVIDE_COERCE
487 #ifdef PROVIDE_FOREIGN
488 /* ForeignObj# operations */
491 , indexCharOffForeignObj
492 , indexIntOffForeignObj
493 , indexInt64OffForeignObj
494 , indexWordOffForeignObj
495 , indexAddrOffForeignObj
496 , indexFloatOffForeignObj
497 , indexDoubleOffForeignObj
498 , indexStablePtrOffForeignObj
501 /* Weak# operations */
505 #ifdef PROVIDE_STABLE
506 /* StablePtr# operations */
512 #ifdef PROVIDE_CONCURRENT
513 /* Concurrency operations */
529 /* If you add a new primop to this table, check you don't
530 * overflow the 256 limit. That is MAX_Primop2 <= 255.
531 * Current value (30/10/98) = 0x42
533 , MAX_Primop2 = i_ccall_IO
536 typedef unsigned int InstrPtr; /* offset of instruction within BCO */
538 /*-------------------------------------------------------------------------*/