/[movitz]/ia-x86/postload.lisp
ViewVC logotype

Contents of /ia-x86/postload.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations)
Tue Feb 10 00:03:52 2004 UTC (10 years, 2 months ago) by ffjeld
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +2 -11 lines
Designate the ia-x86 package with #:ia-x86 rather than "IA-X86".
Also, a few very minor edits.
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 ;;;;------------------------------------------------------------------
15
16 (in-package #:ia-x86)
17
18 (defun table-stats (prefix table)
19 (format t "~&;; ~A ~D x86 instruction templates loaded.~%"
20 prefix
21 (reduce #'+ (map 'list #'length
22 table)))
23
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#)
31
32 (format t "~&;; ~A Average lookup list length is ~,1F.~%"
33 prefix
34 (/ (reduce #'+ (map 'list #'length
35 table))
36 (length table)))
37
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)))))))

  ViewVC Help
Powered by ViewVC 1.1.5