Have sign-extend-complex deal correctly with bytes of size 0.
[movitz-ia-x86.git] / utilities.lisp
bloba072cedc3030d4c7526e28c0c10e2edff9e4a3ca
1 ;;;;------------------------------------------------------------------
2 ;;;;
3 ;;;; Copyright (C) 20012000, 2003-2004, Frode Vatved Fjeld
4 ;;;;
5 ;;;; Filename: utilities.lisp
6 ;;;; Description:
7 ;;;; Author: Nikodemus Siivola
8 ;;;; Created at: Sun Nov 2 14:51:21 EET 2003
9 ;;;; Distribution: See the accompanying file COPYING.
10 ;;;;
11 ;;;; $Id: utilities.lisp,v 1.3 2004/02/10 00:04:24 ffjeld Exp $
12 ;;;;
13 ;;;;------------------------------------------------------------------
15 ;; FIXME: There is probably a better place in the great scheme of
16 ;; things for stuff like this...
17 (in-package #:ia-x86)
19 ;; Unfortunately ANSI doesn't specify the slots and initargs of
20 ;; STYLE-WARNINGS... but we don't want to signal full WARNIGN either,
21 (define-condition style-note (style-warning)
22 ((format :reader style-note-format :initarg :format)
23 (args :reader style-note-args :initarg :args))
24 (:report (lambda (condition stream)
25 (apply #'format
26 stream
27 (style-note-format condition)
28 (style-note-args condition)))))
30 (defun style-note (format &rest args)
31 (signal 'style-note :format format :args args))
33 ;; This is def-... for now, since that's the style followed elsewhere
34 ;; in the assembler.
35 (defmacro def-equal-constant (name expr &optional doc)
36 "ANSI allows only EQL constants. Most lisps swallow EQUAL constants
37 as well, but not all. Hence this portability device."
38 #+acl `(defconstant ,name ,expr ,doc)
39 #+sbcl `(sb-impl::defconstant-eqx ,name ,expr #'equal ,doc)
40 #-(or acl sbcl)
41 `(progn
42 (style-note "DEF-EQUAL-CONSTANT not defined for this implementation. ~
43 Using DEFPARAMETER instead.")
44 (defparameter ,name ,expr ,doc)))