source: branches/working-0711/ccl/lisp-kernel/ppc-uuo.s @ 12415

Last change on this file since 12415 was 4315, checked in by gb, 14 years ago

Whoops. Darwin as doesn't like #.
I dont like Darwin as, but we're back to single-line /* */, which is
often pretty ugly and not well-supported by Emacs.

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