source: branches/arm/lisp-kernel/arm-uuo.s @ 13721

Last change on this file since 13721 was 13721, checked in by gb, 10 years ago

Back out of previous change (encoding allocation size in alloc_trap UUOs;
can determine it from instruction stream.)

File size: 4.4 KB
Line 
1/*   Copyright (C) 2010 Clozure Associates */
2/*   Copyright (C) 1994-2001 Digitool, Inc */
3/*   This file is part of Clozure CL. */
4 
5/*   Clozure CL is licensed under the terms of the Lisp Lesser GNU Public */
6/*   License , known as the LLGPL and distributed with Clozure CL as the */
7/*   file "LICENSE".  The LLGPL consists of a preamble and the LGPL, */
8/*   which is distributed with Clozure CL as the file "LGPL".  Where these */
9/*   conflict, the preamble takes precedence. */
10 
11/*   Clozure CL 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/* As of the 2005 edition of the ARM Architecture Reference Manual */
18/* ("ARM ARM"), instructions I for which:        */
19/* (logand i (logior (ash 255 20) (ash 15 4))) =  */
20/*           (logior (ash 127 20) (ash 15 4))  is true are considered */
21/* "architecturally undefined", e.g., unlikely to be implemented on */
22/* future versions of the architecture.  I haven't seen anything that */
23/* supersedes or contradicts this, but I'm not entirely sure that I would. */
24
25uuo_base_opcode = ((127<<20)|(15<<4))
26                       
27/* Like most 32-bit ARM instructions, these instructions are only executed */
28/* (and therefore only raise exceptions) if their condition field (in bits */
29/* 28:31) is true.  We also have a 12-bit field at bit 20 and a 4-bit field */
30/* at bit 0 in which to encode variable information.  This encoding uses */
31/* the 4-bit field to describe the format of the 12-bit field, which can */
32/* encode 12 bits of "error code", or 8 bits of code and a 4 bit register */
33/* number, or 4 bits of code and 2 4-bit register numbers. */
34       
35uuo_format_nullary = 0          /* 12 bits of code */
36uuo_format_unary = 1            /* 8 bits of info - NOT type info - 4-bit reg */
37uuo_format_error_lisptag = 2    /* 2 bits of lisptag info, 4-bit reg */
38uuo_format_error_fulltag = 3    /* 3 bits of fulltag info, 4 bit reg */
39
40uuo_format_error_xtype = 4   /* 8 bits of extended type/subtag info, 4 bit reg */
41uuo_format_cerror_lisptag = 10 /* continuable, lisptag, reg */
42uuo_format_cerror_fulltag = 11 /* continuable, fulltag, reg */
43uuo_format_cerror_xtype = 12   /* continuable, xtype, reg */       
44uuo_format_binary = 15        /* 4 bits of code, r1, r0 */
45
46/* Encode a UUO with cond = $1, format = $2, info = $3 */
47define(`UUO',`
48        .word (uuo_base_opcode|($1<<28)|$2|($3<<8))
49')
50/* Nullary UUO with cond = $1, info = $2 */       
51define(`nullaryUUO',`UUO($1,uuo_format_nullary,$2)')     
52/* Simple (non-TYPE) unary uuo with cond = $1, reg = $2, info = $3 */
53define(`unaryUUO',`UUO($1,uuo_format_unary,($2|($3<<4)))')
54
55define(`binaryUUO',`UUO($1,uuo_format_binary,($2|($3<<4)|($4<<8)))')
56
57/* Simple type error (reg not lisptag), cond = $1, reg = $2, lisptag = $3 */
58define(`uuo_error_reg_not_lisptag',`UUO($1,uuo_format_error_lisptag,$2|($3<<4))')
59/* Likewise, for fulltag.  (Can distinguish between tag_list/fulltag_cons) */
60define(`uuo_error_reg_not_fulltag',`UUO($1,uuo_format_error_fulltag,$2|($3<<4))')
61/* As used here, an 'xtype' is an 8-bit value that's either a defined */
62/* subtag/tag/lisptag value or some encoding of something like 'integer' */
63define(`uuo_error_reg_not_xtype',`UUO($1,uuo_format_error_xtype,$2|($3<<4))')
64/* Continuable type errors */
65define(`uuo_cerror_reg_not_lisptag',`UUO($1,uuo_format_cerror_lisptag,$2|($3<<4))')
66define(`uuo_cerror_reg_not_fulltag',`UUO($1,uuo_format_cerror_fulltag,$2|($3<<4))')
67define(`uuo_cerror_reg_not_xtype',`UUO($1,uuo_format_cerror_xtype,$2|($3<<4))')
68       
69/* Nullary UUOs.  Define them as being conditional, even if the condition is */
70/*  'al' (always). $1=cond, $2=8-bit-code */
71define(`uuo_alloc_trap',`nullaryUUO($1,0)')
72define(`uuo_error_wrong_nargs',`nullaryUUO($1,1)') /* can use CC field */
73define(`uuo_gc_trap',`nullaryUUO($1,2)') /* probably unconditional */
74define(`uuo_debug_trap',`nullaryUUO($1,3)')
75define(`uuo_interrupt_now',`nullaryUUO($1,4)')
76define(`uuo_suspend_now',`nullaryUUO($1,5)')
77
78/* Unary UUOs */
79define(`uuo_error_unbound',`unaryUUO($1,$2,0)')
80define(`uuo_cerror_unbound',`unaryUUO($1,$2,1)')
81define(`uuo_error_not_callable',`unaryUUO($1,$2,2)')
82define(`uuo_tlb_too_small',`unaryUUO($1,$2,3)')
83define(`uuo_error_no_throw_tag',`unaryUUO($1,$2,4)')
84
85/* Binary UUOs */
86define(`uuo_error_vector_bounds',`binaryUUO($1,$2,$3,0)')
87define(`uuo_error_array_bounds',`binaryUUO($1,$2,$3,1)')
88
Note: See TracBrowser for help on using the repository browser.