Have sign-extend-complex deal correctly with bytes of size 0.
[movitz-ia-x86.git] / postload.lisp
blob1f3bd580957243d2239bd5c273712ea2550171e2
1 ;;;;------------------------------------------------------------------
2 ;;;;
3 ;;;; Copyright (C) 20012000, 2003-2004,
4 ;;;; Department of Computer Science, University of Tromso, Norway
5 ;;;;
6 ;;;; Filename: postload.lisp
7 ;;;; Description:
8 ;;;; Author: Frode Vatvedt Fjeld <frodef@acm.org>
9 ;;;; Created at: Mon Jan 31 16:33:23 2000
10 ;;;; Distribution: See the accompanying file COPYING.
11 ;;;;
12 ;;;; $Id: postload.lisp,v 1.4 2004/02/10 00:03:52 ffjeld Exp $
13 ;;;;
14 ;;;;------------------------------------------------------------------
16 (in-package #:ia-x86)
18 (defun table-stats (prefix table)
19 (format t "~&;; ~A ~D x86 instruction templates loaded.~%"
20 prefix
21 (reduce #'+ (map 'list #'length
22 table)))
24 (format t "~&;; ~A Longest lookup list (#x~2,'0X) has ~D elements.~%"
25 prefix
26 (position #0=(reduce #'max (map 'list #'length
27 table))
28 (map 'list #'length
29 table))
30 #0#)
32 (format t "~&;; ~A Average lookup list length is ~,1F.~%"
33 prefix
34 (/ (reduce #'+ (map 'list #'length
35 table))
36 (length table)))
38 (let ((*print-base* 16)
39 (*print-radix* t))
40 (format t "~&;; ~A There are ~D empty lookup lists (~D%):~%;; ~A~%"
41 prefix
42 #1=(count-if #'null table)
43 (round (* 100 (/ #1# #x100)))
44 (let (r)
45 (dotimes (i #x100 (nreverse r))
46 (when (null (aref table i))
47 (push i r)))))))