source: trunk/ccl/lisp-kernel/uuo.s @ 6

Last change on this file since 6 was 6, checked in by gb, 16 years ago

Initial revision

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
1/*
2   Copyright (C) 1994-2001 Digitool, Inc
3   This file is part of OpenMCL. 
4
5   OpenMCL is licensed under the terms of the Lisp Lesser GNU Public
6   License , known as the LLGPL and distributed with OpenMCL as the
7   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
8   which is distributed with OpenMCL as the file "LGPL".  Where these
9   conflict, the preamble takes precedence. 
10
11   OpenMCL is referenced in the preamble as the "LIBRARY."
12
13   The LLGPL is also available online at
14   http://opensource.franz.com/preamble.html
15*/
16
17
18/* 06/10/96 gb  uuo_fixnum_overflow */
19/* --- 3.9 release */
20
21/* A uuo looks like: */
22/*  0      5 6                  15 16   20 21          27 28  31 */
23/* +--------+-----------------------------+--------------+------+ */
24/* |   0    |XXXXXXXXXXXXXXXXXXXX |  RB   |  <minor op>  |  11  | */
25/* +--------+-----------------------------+--------------+------+ */
26/* */
27/* e.g., the major opcode (bits 0-5) is 0, the low 4 bits (bits 28-31) */
28/* have the value "11" decimal (that's tagged as an immediate as far */
29/* as lisp is concerned, a 7-bit opcode in bits 21-27, and the format */
30/* of bits 6-20 depend on the value of the minor opcode, though typically */
31/* bits 16-20 are used to specify a register value between 0 and 31. */
32/* */
33/* There are a few cases where bits 6-15 are also used to denote registers */
34/* (RT and RA, as in an X-form PPC instruction), some where bits 6-10 are */
35/* to be interpreted as a constant (error number or type code), and some */
36/* where bits 6-15 do so. */
37/* */
38/* Since C code is typically more interested in disassembling UUOs, the */
39/* full list of UUOs is in "uuo.h".  This file contains macros for creating */
40/* them. */
41/* */
42/* Of course, there -is- no such file as "uuo.h".  That's a stale comment. */
43/* For all anyone knows, so is this one. */
44
45UUO_TAG = 11
46UUU_MINOR_SHIFT = 4
47UUO_RB_SHIFT = 11
48UUO_RA_SHIFT = 16
49UUO_RT_SHIFT = 21
50
51define([rt_ra_uuo],[
52        .long (UUO_TAG|(($1)<<UUU_MINOR_SHIFT)|(($3)<<UUO_RA_SHIFT)|(($2)<<UUO_RT_SHIFT))])
53
54define([rt_ra_rb_uuo],[
55        .long (UUO_TAG|(($1)<<UUU_MINOR_SHIFT)|(($3)<<UUO_RA_SHIFT)|(($4)<<UUO_RB_SHIFT)|(($2)<<UUO_RT_SHIFT))])
56       
57define([errnum_rb_uuo],[
58        .long (UUO_TAG|(($1)<<UUU_MINOR_SHIFT)|(($2)<<UUO_RA_SHIFT)|(($3)<<UUO_RB_SHIFT))])
59       
60define([errnum_ra_rb_uuo],[ /* minorop,errnum,ra,rb*/
61        .long (UUO_TAG|(($1)<<UUU_MINOR_SHIFT)|(($2)<<UUO_RA_SHIFT)|(($3)<<UUO_RB_SHIFT)|((\errnum)<<UUO_RT_SHIFT))])
62       
63       
64       
65/* Signal an internal error - type error or whatever - with error  */
66/* number (0-1023) and "register" argument. */
67
68define([uuo_interr],[
69        errnum_rb_uuo(11,$1,$2)])
70       
71/* As above, but make the error continuable.  (A branch presumably */
72/* follows the UUO opcode.) */
73
74define([uuo_intcerr],[
75        errnum_rb_uuo(12,$1,$2)])
76
77
78/* Signal an error with a much smaller error number (0-31) and */
79/* two "register" fields. */
80
81define([uuo_interr2],[
82        errnum_ra_rb_uuo(13,$1,$2,$3)])
83       
84/* Continuably .... */
85
86define([uuo_intcerr2],[
87        errnum_ra_rb_uuo(14,$1,$2,$3)])
88
89       
90
91/* A distinguished UUO: the handler should zero the FPSCR */
92define([uuo_zero_fpscr],[
93        rt_ra_rb_uuo(25,0,0,0)])
Note: See TracBrowser for help on using the repository browser.