source: branches/1.2-devel/ccl/compiler/subprims.lisp @ 15278

Last change on this file since 15278 was 2758, checked in by gb, 14 years ago

Subprim defs are architecture and/or backend-specific.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.5 KB
Line 
1;;;-*- Mode: Lisp; Package: CCL -*-
2;;;
3;;;   Copyright (C) 1994-2001 Digitool, Inc
4;;;   This file is part of OpenMCL. 
5;;;
6;;;   OpenMCL is licensed under the terms of the Lisp Lesser GNU Public
7;;;   License , known as the LLGPL and distributed with OpenMCL as the
8;;;   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
9;;;   which is distributed with OpenMCL as the file "LGPL".  Where these
10;;;   conflict, the preamble takes precedence. 
11;;;
12;;;   OpenMCL is referenced in the preamble as the "LIBRARY."
13;;;
14;;;   The LLGPL is also available online at
15;;;   http://opensource.franz.com/preamble.html
16
17(in-package "CCL")
18
19(defstruct subprimitive-info
20  name
21  offset
22  nailed-down
23  argument-mask
24  registers-used
25  )
26
27(defmethod make-load-form ((s subprimitive-info) &optional env)
28  (make-load-form-saving-slots s :environment env))
29
30(defmethod print-object ((s subprimitive-info) stream)
31  (print-unreadable-object (s stream :type t)
32    (format stream "~A @ #x~x" 
33            (subprimitive-info-name s)
34            (subprimitive-info-offset s))))
35
36(defun %subprim-name->offset (name table)
37  (let* ((sprec (find name table 
38                      :test #'string-equal 
39                      :key #'subprimitive-info-name)))
40    (if sprec
41      (subprimitive-info-offset sprec)
42      (error "subprim named ~s not found." name))))
43
44(defun subprim-name->offset (name &optional (backend *target-backend*))
45  (%subprim-name->offset name  (arch::target-subprims-table
46                                (backend-target-arch backend))))
47
48(provide "SUBPRIMS")
Note: See TracBrowser for help on using the repository browser.