From a8ea048d55517cc2e1c054821c6169d2f9816a98 Mon Sep 17 00:00:00 2001 From: "Paul A. Patience" Date: Fri, 28 Jun 2024 21:44:39 -0400 Subject: [PATCH] math: move feature tests outside of DEFTYPE WORD When DEFTYPE WORD contains the feature tests for QUAVIVER/BIGNUM-ELISION, ECL and Clasp seem to have trouble understanding the type declarations in Dragonbox. --- code/math/implementation.lisp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/code/math/implementation.lisp b/code/math/implementation.lisp index 50991689..a5e4ea5a 100644 --- a/code/math/implementation.lisp +++ b/code/math/implementation.lisp @@ -1,18 +1,20 @@ (in-package #:quaviver/math) +#+quaviver/bignum-elision (deftype word (arithmetic-size &optional (count 1)) - #+quaviver/bignum-elision - (ecase arithmetic-size - (32 (case count - (1 `(unsigned-byte 32)) - (2 `(unsigned-byte 64)) - (otherwise `(simple-array (unsigned-byte 64) (,(ceiling count 2)))))) - (64 (if (eql count 1) - `(unsigned-byte 64) - `(simple-array (unsigned-byte 64) (,count)))) - (128 `(simple-array (unsigned-byte 64) (,(ash count 1))))) - #-quaviver/bignum-elision - `(unsigned-byte ,(* arithmetic-size count))) + (ecase arithmetic-size + (32 (case count + (1 `(unsigned-byte 32)) + (2 `(unsigned-byte 64)) + (otherwise `(simple-array (unsigned-byte 64) (,(ceiling count 2)))))) + (64 (if (eql count 1) + `(unsigned-byte 64) + `(simple-array (unsigned-byte 64) (,count)))) + (128 `(simple-array (unsigned-byte 64) (,(ash count 1)))))) + +#-quaviver/bignum-elision +(deftype word (arithmetic-size &optional (count 1)) + `(unsigned-byte ,(* arithmetic-size count))) ;;; Bignum elision ;;;