From e83bd3dfb4cc33037ea8a353336d95a8cfcaa580 Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Tue, 17 Aug 2010 19:42:26 +0200 Subject: [PATCH] Unboxed type SHORT-FLOAT removed from the core. --- src/c/alloc.d | 4 - src/c/alloc_2.d | 3 - src/c/cmpaux.d | 12 --- src/c/format.d | 8 -- src/c/gbc.d | 3 - src/c/hash.d | 22 ----- src/c/instance.d | 3 - src/c/main.d | 3 - src/c/num_arith.d | 203 --------------------------------------- src/c/num_co.d | 169 -------------------------------- src/c/num_comp.d | 46 --------- src/c/num_pred.d | 16 --- src/c/num_rand.d | 6 -- src/c/num_sfun.d | 53 ---------- src/c/number.d | 52 ---------- src/c/predicate.d | 16 --- src/c/print.d | 13 --- src/c/read.d | 3 - src/c/typespec.d | 4 - src/cmp/cmparray.lsp | 10 +- src/cmp/cmpc-inliner.lsp | 6 +- src/cmp/cmpnum.lsp | 6 +- src/cmp/cmpopt.lsp | 6 +- src/cmp/sysfun.lsp | 3 - src/h/external.h | 4 - src/h/object.h | 3 - src/lsp/predlib.lsp | 23 +---- 27 files changed, 13 insertions(+), 687 deletions(-) diff --git a/src/c/alloc.d b/src/c/alloc.d index 7c8c1606a..d9d646d82 100644 --- a/src/c/alloc.d +++ b/src/c/alloc.d @@ -235,10 +235,6 @@ ecl_alloc_object(cl_type t) return MAKE_FIXNUM(0); /* Immediate fixnum */ case t_character: return CODE_CHAR('\0'); /* Immediate character */ -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return make_shortfloat(0.0); /* Immediate float */ -#endif default:; } diff --git a/src/c/alloc_2.d b/src/c/alloc_2.d index 9972af54d..02b666dc3 100755 --- a/src/c/alloc_2.d +++ b/src/c/alloc_2.d @@ -495,9 +495,6 @@ ecl_alloc_object(cl_type t) return MAKE_FIXNUM(0); /* Immediate fixnum */ case t_character: return CODE_CHAR(' '); /* Immediate character */ -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: -#endif #ifdef ECL_LONG_FLOAT case t_longfloat: #endif diff --git a/src/c/cmpaux.d b/src/c/cmpaux.d index c4164bcc4..37bf39209 100644 --- a/src/c/cmpaux.d +++ b/src/c/cmpaux.d @@ -77,10 +77,6 @@ ecl_to_fixnum(cl_object x) /* case t_character: return (cl_fixnum)CHAR_CODE(x); */ case t_ratio: return (cl_fixnum)ecl_to_double(x); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return (cl_fixnum)ecl_short_float(x); -#endif case t_singlefloat: return (cl_fixnum)sf(x); case t_doublefloat: @@ -103,10 +99,6 @@ ecl_to_unsigned_integer(cl_object x) return fixnnint(x); case t_ratio: return (cl_index)ecl_to_double(x); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return (cl_index)ecl_short_float(x); -#endif case t_singlefloat: return (cl_index)sf(x); case t_doublefloat: @@ -131,10 +123,6 @@ ecl_to_float(cl_object x) case t_bignum: case t_ratio: return ecl_to_double(x); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return ecl_short_float(x); -#endif case t_singlefloat: return sf(x); case t_doublefloat: diff --git a/src/c/format.d b/src/c/format.d index 379c8c748..c2ed6329b 100644 --- a/src/c/format.d +++ b/src/c/format.d @@ -1064,20 +1064,12 @@ fmt_exponential_float(format_stack fmt, bool colon, bool atsign) } else if (y == @'single-float') { t = t_singlefloat; } else { -#ifdef ECL_SHORT_FLOAT - t = t_shortfloat; -#else t = t_singlefloat; -#endif } if (type_of(x) == t) exponentchar = 'E'; else if (type_of(x) == t_singlefloat) exponentchar = 'F'; -#ifdef ECL_SHORT_FLOAT - else if (type_of(x) == t_shortfloat) - exponentchar = 'S'; -#endif #ifdef ECL_LONG_FLOAT else if (type_of(x) == t_longfloat) exponentchar = 'L'; diff --git a/src/c/gbc.d b/src/c/gbc.d index 807adbb80..1ca896df0 100644 --- a/src/c/gbc.d +++ b/src/c/gbc.d @@ -153,9 +153,6 @@ BEGIN: mark_next(x->ratio.den); break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: -#endif case t_singlefloat: case t_doublefloat: #ifdef ECL_LONG_FLOAT diff --git a/src/c/hash.d b/src/c/hash.d index 6ddf30904..107b74e1d 100644 --- a/src/c/hash.d +++ b/src/c/hash.d @@ -54,12 +54,6 @@ _hash_eql(cl_hashkey h, cl_object x) case t_ratio: h = _hash_eql(h, x->ratio.num); return _hash_eql(h, x->ratio.den); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: { - float f = ecl_short_float(x); - return hash_string(h, (unsigned char*)&f, sizeof(f)); - } -#endif case t_singlefloat: return hash_string(h, (unsigned char*)&sf(x), sizeof(sf(x))); case t_doublefloat: @@ -127,12 +121,6 @@ _hash_equal(int depth, cl_hashkey h, cl_object x) case t_random: return _hash_equal(0, h, x->random.value); #ifdef ECL_SIGNED_ZERO -# ifdef ECL_SHORT_FLOAT - case t_shortfloat: { - float f = ecl_short_float(x); - return hash_string(h, (unsigned char*)&f, sizeof(f)); - } -# endif case t_singlefloat: { float f = sf(x); if (f == 0.0) f = 0.0; @@ -198,16 +186,6 @@ _hash_equalp(int depth, cl_hashkey h, cl_object x) return h; case t_fixnum: return hash_word(h, fix(x)); -#ifdef HAVE_SHORT_FLOAT - case t_shortfloat: { - /* FIXME! We should be more precise here! */ - return hash_word(h, (cl_index)sf(x)); - union { float f; cl_index w; } x; - x.w = 0; - x.f = ecl_short_float(x); - return hash_word(h, x.w); - } -#endif case t_singlefloat: /* FIXME! We should be more precise here! */ return hash_word(h, (cl_index)sf(x)); diff --git a/src/c/instance.d b/src/c/instance.d index a035ec619..f4ca7fa0a 100644 --- a/src/c/instance.d +++ b/src/c/instance.d @@ -281,9 +281,6 @@ cl_class_of(cl_object x) index = ECL_BUILTIN_INTEGER; break; case t_ratio: index = ECL_BUILTIN_RATIO; break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: -#endif case t_singlefloat: case t_doublefloat: #ifdef ECL_LONG_FLOAT diff --git a/src/c/main.d b/src/c/main.d index 8ce5ecd92..758ee429b 100644 --- a/src/c/main.d +++ b/src/c/main.d @@ -161,9 +161,6 @@ static const char *feature_names[] = { #ifdef ECL_LONG_FLOAT "LONG-FLOAT", #endif -#ifdef ECL_SHORT_FLOAT - "SHORT-FLOAT", -#endif #ifdef ECL_RELATIVE_PACKAGE_NAMES "RELATIVE-PACKAGE-NAMES", #endif diff --git a/src/c/num_arith.d b/src/c/num_arith.d index 9713dfc1f..d171d2565 100644 --- a/src/c/num_arith.d +++ b/src/c/num_arith.d @@ -46,10 +46,6 @@ ecl_times(cl_object x, cl_object y) case t_ratio: z = ecl_times(x, y->ratio.num); return ecl_make_ratio(z, y->ratio.den); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return make_shortfloat(fix(x) * ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_singlefloat(fix(x) * sf(y)); case t_doublefloat: @@ -72,10 +68,6 @@ ecl_times(cl_object x, cl_object y) case t_ratio: z = ecl_times(x, y->ratio.num); return ecl_make_ratio(z, y->ratio.den); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return make_shortfloat(ecl_to_double(x) * ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_singlefloat(ecl_to_double(x) * sf(y)); case t_doublefloat: @@ -99,10 +91,6 @@ ecl_times(cl_object x, cl_object y) z = ecl_times(x->ratio.num,y->ratio.num); z1 = ecl_times(x->ratio.den,y->ratio.den); return ecl_make_ratio(z, z1); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return make_shortfloat(ecl_to_double(x) * ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_singlefloat(ecl_to_double(x) * sf(y)); case t_doublefloat: @@ -116,32 +104,6 @@ ecl_times(cl_object x, cl_object y) default: FEwrong_type_nth_arg(@[*], 2, y, @[number]); } -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: { - float fx = ecl_short_float(x); - switch (type_of(y)) { - case t_fixnum: - return make_shortfloat(fx * fix(y)); - case t_bignum: - case t_ratio: - return make_shortfloat(fx * ecl_to_double(y)); - case t_shortfloat: - return make_shortfloat(fx * ecl_short_float(y)); - case t_singlefloat: - return make_shortfloat(fx * sf(y)); - case t_doublefloat: - return ecl_make_doublefloat(fx * sf(x)); -#ifdef ECL_LONG_FLOAT - case t_longfloat: - return ecl_make_longfloat(fx * ecl_long_float(y)); -#endif - case t_complex: - goto COMPLEX; - default: - FEwrong_type_nth_arg(@[*], 2, y, @[number]); - } - } -#endif case t_singlefloat: { float fx = sf(x); switch (type_of(y)) { @@ -150,10 +112,6 @@ ecl_times(cl_object x, cl_object y) case t_bignum: case t_ratio: return ecl_make_singlefloat(fx * ecl_to_double(y)); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return ecl_make_singlefloat(fx * ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_singlefloat(fx * sf(y)); case t_doublefloat: @@ -175,10 +133,6 @@ ecl_times(cl_object x, cl_object y) case t_bignum: case t_ratio: return ecl_make_doublefloat(df(x) * ecl_to_double(y)); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return ecl_make_doublefloat(df(x) * ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_doublefloat(df(x) * sf(y)); case t_doublefloat: @@ -205,10 +159,6 @@ ecl_times(cl_object x, cl_object y) case t_bignum: case t_ratio: return ecl_make_longfloat(lx * ecl_to_double(y)); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return ecl_make_longfloat(lx * ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_longfloat(lx * sf(y)); case t_doublefloat: @@ -269,10 +219,6 @@ ecl_plus(cl_object x, cl_object y) z = ecl_times(x, y->ratio.den); z = ecl_plus(z, y->ratio.num); return ecl_make_ratio(z, y->ratio.den); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return make_shortfloat(fix(x) + ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_singlefloat(fix(x) + sf(y)); case t_doublefloat: @@ -298,10 +244,6 @@ ecl_plus(cl_object x, cl_object y) z = ecl_times(x, y->ratio.den); z = ecl_plus(z, y->ratio.num); return ecl_make_ratio(z, y->ratio.den); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return make_shortfloat(ecl_to_double(x) + ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_singlefloat(ecl_to_double(x) + sf(y)); case t_doublefloat: @@ -328,10 +270,6 @@ ecl_plus(cl_object x, cl_object y) z = ecl_plus(z1, z); z1 = ecl_times(x->ratio.den,y->ratio.den); return ecl_make_ratio(z, z1); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return make_shortfloat(ecl_to_double(x) + ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_singlefloat(ecl_to_double(x) + sf(y)); case t_doublefloat: @@ -345,30 +283,6 @@ ecl_plus(cl_object x, cl_object y) default: FEwrong_type_nth_arg(@[+], 2, y, @[number]); } -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - switch (type_of(y)) { - case t_fixnum: - return make_shortfloat(ecl_short_float(x) + fix(y)); - case t_bignum: - case t_ratio: - return make_shortfloat(ecl_short_float(x) + ecl_to_double(y)); - case t_shortfloat: - return make_shortfloat(ecl_short_float(x) + ecl_short_float(y)); - case t_singlefloat: - return make_shortfloat(ecl_short_float(x) + sf(y)); - case t_doublefloat: - return ecl_make_doublefloat(ecl_short_float(x) + df(y)); -#ifdef ECL_LONG_FLOAT - case t_longfloat: - return ecl_make_longfloat(ecl_short_float(x) + ecl_long_float(y)); -#endif - case t_complex: - goto COMPLEX; - default: - FEwrong_type_nth_arg(@[+], 2, y, @[number]); - } -#endif case t_singlefloat: switch (type_of(y)) { case t_fixnum: @@ -376,10 +290,6 @@ ecl_plus(cl_object x, cl_object y) case t_bignum: case t_ratio: return ecl_make_singlefloat(sf(x) + ecl_to_double(y)); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return make_shortfloat(sf(x) + ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_singlefloat(sf(x) + sf(y)); case t_doublefloat: @@ -400,10 +310,6 @@ ecl_plus(cl_object x, cl_object y) case t_bignum: case t_ratio: return ecl_make_doublefloat(df(x) + ecl_to_double(y)); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return ecl_make_doublefloat(df(x) + ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_doublefloat(df(x) + sf(y)); case t_doublefloat: @@ -425,10 +331,6 @@ ecl_plus(cl_object x, cl_object y) case t_bignum: case t_ratio: return ecl_make_longfloat(ecl_long_float(x) + ecl_to_double(y)); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return ecl_make_longfloat(ecl_long_float(x) + ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_longfloat(ecl_long_float(x) + sf(y)); case t_doublefloat: @@ -484,10 +386,6 @@ ecl_minus(cl_object x, cl_object y) z = ecl_times(x, y->ratio.den); z = ecl_minus(z, y->ratio.num); return ecl_make_ratio(z, y->ratio.den); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return make_shortfloat(fix(x) - ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_singlefloat(fix(x) - sf(y)); case t_doublefloat: @@ -511,10 +409,6 @@ ecl_minus(cl_object x, cl_object y) z = ecl_times(x, y->ratio.den); z = ecl_minus(z, y->ratio.num); return ecl_make_ratio(z, y->ratio.den); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return make_shortfloat(ecl_to_double(x) - ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_singlefloat(ecl_to_double(x) - sf(y)); case t_doublefloat: @@ -541,10 +435,6 @@ ecl_minus(cl_object x, cl_object y) z = ecl_minus(z, z1); z1 = ecl_times(x->ratio.den,y->ratio.den); return ecl_make_ratio(z, z1); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return make_shortfloat(ecl_to_double(x) - ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_singlefloat(ecl_to_double(x) - sf(y)); case t_doublefloat: @@ -558,30 +448,6 @@ ecl_minus(cl_object x, cl_object y) default: FEwrong_type_nth_arg(@[-], 2, y, @[number]); } -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - switch (type_of(y)) { - case t_fixnum: - return make_shortfloat(ecl_short_float(x) - fix(y)); - case t_bignum: - case t_ratio: - return make_shortfloat(ecl_short_float(x) - ecl_to_double(y)); - case t_shortfloat: - return make_shortfloat(ecl_short_float(x) - ecl_short_float(y)); - case t_singlefloat: - return make_shortfloat(ecl_short_float(x) - sf(y)); - case t_doublefloat: - return ecl_make_doublefloat(ecl_short_float(x) - df(y)); -#ifdef ECL_LONG_FLOAT - case t_longfloat: - return ecl_make_longfloat(ecl_short_float(x) - ecl_long_float(y)); -#endif - case t_complex: - goto COMPLEX; - default: - FEwrong_type_nth_arg(@[-], 2, y, @[number]); - } -#endif case t_singlefloat: switch (type_of(y)) { case t_fixnum: @@ -589,10 +455,6 @@ ecl_minus(cl_object x, cl_object y) case t_bignum: case t_ratio: return ecl_make_singlefloat(sf(x) - ecl_to_double(y)); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return make_shortfloat(sf(x) - ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_singlefloat(sf(x) - sf(y)); case t_doublefloat: @@ -613,10 +475,6 @@ ecl_minus(cl_object x, cl_object y) case t_bignum: case t_ratio: return ecl_make_doublefloat(df(x) - ecl_to_double(y)); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return ecl_make_doublefloat(df(x) - ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_doublefloat(df(x) - sf(y)); case t_doublefloat: @@ -638,10 +496,6 @@ ecl_minus(cl_object x, cl_object y) case t_bignum: case t_ratio: return ecl_make_longfloat(ecl_long_float(x) - ecl_to_double(y)); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return ecl_make_longfloat(ecl_long_float(x) - ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_longfloat(ecl_long_float(x) - sf(y)); case t_doublefloat: @@ -709,10 +563,6 @@ ecl_negate(cl_object x) z->ratio.num = z1; z->ratio.den = x->ratio.den; return z; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return make_shortfloat(-ecl_shortfloat(x)); -#endif case t_singlefloat: z = ecl_alloc_object(t_singlefloat); sf(z) = -sf(x); @@ -768,10 +618,6 @@ ecl_divide(cl_object x, cl_object y) case t_ratio: z = ecl_times(x, y->ratio.den); return ecl_make_ratio(z, y->ratio.num); -#ifdef ECL_SHORT_FLAOT - case t_shortfloat: - return make_shortfloat(ecl_to_double(x) / ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_singlefloat(ecl_to_double(x) / sf(y)); case t_doublefloat: @@ -797,10 +643,6 @@ ecl_divide(cl_object x, cl_object y) z = ecl_times(x->ratio.num,y->ratio.den); z1 = ecl_times(x->ratio.den,y->ratio.num); return ecl_make_ratio(z, z1); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return make_shortfloat(ecl_to_double(x) / ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_singlefloat(ecl_to_double(x) / sf(y)); case t_doublefloat: @@ -814,30 +656,6 @@ ecl_divide(cl_object x, cl_object y) default: FEwrong_type_nth_arg(@[/], 2, y, @[number]); } -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - switch (type_of(y)) { - case t_fixnum: - return make_shortfloat(ecl_short_float(x) / fix(y)); - case t_bignum: - case t_ratio: - return make_shortfloat(ecl_short_float(x) / ecl_to_double(y)); - case t_shortfloat: - return make_shortfloat(ecl_short_float(x) / ecl_short_float(y)); - case t_singlefloat: - return make_shortfloat(ecl_short_float(x) / sf(y)); - case t_doublefloat: - return ecl_make_doublefloat(ecl_short_float(x) / df(y)); -#ifdef ECL_LONG_FLOAT - case t_longfloat: - return ecl_make_longfloat(ecl_short_float(x) / ecl_long_float(y)); -#endif - case t_complex: - goto COMPLEX; - default: - FEwrong_type_nth_arg(@[/], 2, y, @[number]); - } -#endif case t_singlefloat: switch (type_of(y)) { case t_fixnum: @@ -845,10 +663,6 @@ ecl_divide(cl_object x, cl_object y) case t_bignum: case t_ratio: return ecl_make_singlefloat(sf(x) / ecl_to_double(y)); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return make_shortfloat(sf(x) / ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_singlefloat(sf(x) / sf(y)); case t_doublefloat: @@ -869,10 +683,6 @@ ecl_divide(cl_object x, cl_object y) case t_bignum: case t_ratio: return ecl_make_doublefloat(df(x) / ecl_to_double(y)); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return ecl_make_doublefloat(df(x) / ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_doublefloat(df(x) / sf(y)); case t_doublefloat: @@ -894,10 +704,6 @@ ecl_divide(cl_object x, cl_object y) case t_bignum: case t_ratio: return ecl_make_longfloat(ecl_long_float(x) / ecl_to_double(y)); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return ecl_make_longfloat(ecl_long_float(x) / ecl_short_float(y)); -#endif case t_singlefloat: return ecl_make_longfloat(ecl_long_float(x) / sf(y)); case t_doublefloat: @@ -1037,10 +843,6 @@ ecl_one_plus(cl_object x) z = ecl_plus(x->ratio.num, x->ratio.den); return ecl_make_ratio(z, x->ratio.den); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return make_shortfloat(1.0 + ecl_short_float(x)); -#endif case t_singlefloat: z = ecl_alloc_object(t_singlefloat); sf(z) = sf(x) + 1.0; @@ -1091,11 +893,6 @@ ecl_one_minus(cl_object x) z = ecl_minus(x->ratio.num, x->ratio.den); return ecl_make_ratio(z, x->ratio.den); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return make_shortfloat(ecl_short_float(x) - 1.0); -#endif - case t_singlefloat: z = ecl_alloc_object(t_singlefloat); sf(z) = sf(x) - 1.0; diff --git a/src/c/num_co.d b/src/c/num_co.d index 3260fe0b4..dedd7d1da 100644 --- a/src/c/num_co.d +++ b/src/c/num_co.d @@ -63,9 +63,6 @@ number_remainder(cl_object x, cl_object y, cl_object q) ty = t_singlefloat; } switch (tx = type_of(x)) { -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: -#endif case t_singlefloat: case t_doublefloat: #ifdef ECL_LONG_FLOAT @@ -77,10 +74,6 @@ number_remainder(cl_object x, cl_object y, cl_object q) case t_bignum: case t_ratio: switch (ty) { -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - x = make_shortfloat(ecl_to_double(x)); break; -#endif case t_singlefloat: x = ecl_make_singlefloat(ecl_to_double(x)); break; case t_doublefloat: @@ -147,15 +140,6 @@ ecl_floor1(cl_object x) v0 = ecl_floor2(x->ratio.num, x->ratio.den); v1 = ecl_make_ratio(VALUES(1), x->ratio.den); break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: { - float d = ecl_short_float(x); - float y = floorf(d); - v0 = float_to_integer(y); - v1 = make_shortfloat(d - y); - break; - } -#endif case t_singlefloat: { float d = sf(x); float y = floorf(d); @@ -225,16 +209,6 @@ ecl_floor2(cl_object x, cl_object y) v0 = ecl_floor2(ecl_times(x, y->ratio.den), y->ratio.num); v1 = ecl_make_ratio(VALUES(1), y->ratio.den); break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: { /* FIX / SF */ - float n = ecl_short_float(y); - float p = fix(x) / n; - float q = floorf(p); - v0 = float_to_integer(q); - v1 = make_shortfloat((p - q)*n); - break; - } -#endif case t_singlefloat: { /* FIX / SF */ float n = sf(y); float p = fix(x) / n; @@ -281,16 +255,6 @@ ecl_floor2(cl_object x, cl_object y) v0 = ecl_floor2(ecl_times(x, y->ratio.den), y->ratio.num); v1 = ecl_make_ratio(VALUES(1), y->ratio.den); break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: { /* BIG / SF */ - float n = ecl_short_float(y); - float p = _ecl_big_to_double(x) / n; - float q = floorf(p); - v0 = float_to_integer(q); - v1 = make_shortfloat((p - q)*n); - break; - } -#endif case t_singlefloat: { /* BIG / SF */ float n = sf(y); float p = _ecl_big_to_double(x) / n; @@ -333,16 +297,6 @@ ecl_floor2(cl_object x, cl_object y) v1 = ecl_divide(VALUES(1), x->ratio.den); } break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: { /* SF / ANY */ - float n = ecl_to_double(y); - float p = sf(x)/n; - float q = floorf(p); - v0 = float_to_integer(q); - v1 = make_shortfloat(p*n - q*n); - break; - } -#endif case t_singlefloat: { /* SF / ANY */ float n = ecl_to_double(y); float p = sf(x)/n; @@ -401,15 +355,6 @@ ecl_ceiling1(cl_object x) v0 = ecl_ceiling2(x->ratio.num, x->ratio.den); v1 = ecl_make_ratio(VALUES(1), x->ratio.den); break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: { - float d = ecl_short_float(x); - float y = ceilf(d); - v0 = float_to_integer(y); - v1 = make_shortfloat(d - y); - break; - } -#endif case t_singlefloat: { float d = sf(x); float y = ceilf(d); @@ -479,16 +424,6 @@ ecl_ceiling2(cl_object x, cl_object y) v0 = ecl_ceiling2(ecl_times(x, y->ratio.den), y->ratio.num); v1 = ecl_make_ratio(VALUES(1), y->ratio.den); break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: { /* FIX / SF */ - float n = ecl_short_float(y); - float p = fix(x)/n; - float q = ceilf(p); - v0 = float_to_integer(q); - v1 = ecl_make_singlefloat(p*n - q*n); - break; - } -#endif case t_singlefloat: { /* FIX / SF */ float n = sf(y); float p = fix(x)/n; @@ -535,16 +470,6 @@ ecl_ceiling2(cl_object x, cl_object y) v0 = ecl_ceiling2(ecl_times(x, y->ratio.den), y->ratio.num); v1 = ecl_make_ratio(VALUES(1), y->ratio.den); break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: { /* BIG / SF */ - float n = ecl_short_float(y); - float p = _ecl_big_to_double(x)/n; - float q = ceilf(p); - v0 = float_to_integer(q); - v1 = make_shortfloat(p*n - q*n); - break; - } -#endif case t_singlefloat: { /* BIG / SF */ float n = sf(y); float p = _ecl_big_to_double(x)/n; @@ -587,16 +512,6 @@ ecl_ceiling2(cl_object x, cl_object y) v1 = ecl_divide(VALUES(1), x->ratio.den); } break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: { /* SF / ANY */ - float n = ecl_to_double(y); - float p = sf(x)/n; - float q = ceilf(p); - v0 = float_to_integer(q); - v1 = make_shortfloat(p*n - q*n); - break; - } -#endif case t_singlefloat: { /* SF / ANY */ float n = ecl_to_double(y); float p = sf(x)/n; @@ -653,15 +568,6 @@ ecl_truncate1(cl_object x) v0 = ecl_truncate2(x->ratio.num, x->ratio.den); v1 = ecl_make_ratio(VALUES(1), x->ratio.den); break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: { - float d = ecl_short_float(x); - float y = d > 0? floorf(d) : ceilf(d); - v0 = float_to_integer(y); - v1 = make_shortfloat(d - y); - break; - } -#endif case t_singlefloat: { float d = sf(x); float y = d > 0? floorf(d) : ceilf(d); @@ -765,11 +671,6 @@ ecl_round1(cl_object x) v0 = ecl_round2(x->ratio.num, x->ratio.den); v1 = ecl_make_ratio(VALUES(1), x->ratio.den); break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - f = ecl_short_float(x); - goto FLOAT; -#endif case t_singlefloat: { float d = sf(x); float q = round_double(d); @@ -874,11 +775,6 @@ cl_decode_float(cl_object x) float f; switch (tx) { -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - f = ecl_short_float(x); - goto FLOAT; -#endif case t_singlefloat: { f = sf(x); FLOAT: @@ -936,11 +832,6 @@ cl_scale_float(cl_object x, cl_object y) FEwrong_type_nth_arg(@[scale-float],2,y,@[fixnum]); } switch (type_of(x)) { -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - x = make_shortfloat(ldexpf(ecl_short_float(x), k)); - break; -#endif case t_singlefloat: x = ecl_make_singlefloat(ldexpf(sf(x), k)); break; @@ -975,10 +866,6 @@ cl_float_radix(cl_object x) y = cl_float(2, MAKE_FIXNUM(1), x); } switch (type_of(x)) { -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - negativep = signbit(ecl_short_float(x)); break; -#endif case t_singlefloat: negativep = signbit(sf(x)); break; case t_doublefloat: @@ -991,13 +878,6 @@ cl_float_radix(cl_object x) FEwrong_type_nth_arg(@[float-sign],1,x,@[float]); } switch (type_of(y)) { -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: { - float f = ecl_short_float(y); - if (signbit(f) != negativep) y = make_shortfloat(-f); - break; - } -#endif case t_singlefloat: { float f = sf(y); if (signbit(f) != negativep) y = ecl_make_singlefloat(-f); @@ -1026,9 +906,6 @@ cl_float_digits(cl_object x) { const cl_env_ptr the_env = ecl_process_env(); switch (type_of(x)) { -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: -#endif case t_singlefloat: x = MAKE_FIXNUM(FLT_MANT_DIG); break; @@ -1052,23 +929,6 @@ cl_float_precision(cl_object x) const cl_env_ptr the_env = ecl_process_env(); int precision; switch (type_of(x)) { -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: { - float f = ecl_short_float(x); - if (f == 0.0) { - precision = 0; - } else { - int exp; - frexpf(f, &exp); - if (exp >= FLT_MIN_EXP) { - precision = FLT_MANT_DIG; - } else { - precision = FLT_MANT_DIG - (FLT_MIN_EXP - exp); - } - } - break; - } -#endif case t_singlefloat: { float f = sf(x); if (f == 0.0) { @@ -1180,24 +1040,6 @@ cl_integer_decode_float(cl_object x) } break; } -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: { - float d = ecl_short_float(x); - if (signbit(d)) { - s = -1; - d = -d; - } - if (d == 0.0) { - e = 0; - x = MAKE_FIXNUM(0); - } else { - d = frexpf(d, &e); - x = double_to_integer(ldexp(d, FLT_MANT_DIG)); - e -= FLT_MANT_DIG; - } - break; - } -#endif default: FEwrong_type_nth_arg(@[integer-decode-float],1,x,@[float]); } @@ -1217,9 +1059,6 @@ cl_realpart(cl_object x) case t_fixnum: case t_bignum: case t_ratio: -#ifdef ECL_SHORT_FLOAT - case t_longfloat: -#endif case t_singlefloat: case t_doublefloat: #ifdef ECL_LONG_FLOAT @@ -1244,14 +1083,6 @@ cl_imagpart(cl_object x) case t_ratio: x = MAKE_FIXNUM(0); break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - if (signbit(ecl_short_float(x))) - x = make_shortfloat(-0.0); - else - x = make_shortfloat(0.0); - break; -#endif case t_singlefloat: if (signbit(sf(x))) x = cl_core.singlefloat_minus_zero; diff --git a/src/c/num_comp.d b/src/c/num_comp.d index 17862aa7f..45563e107 100644 --- a/src/c/num_comp.d +++ b/src/c/num_comp.d @@ -103,10 +103,6 @@ ecl_number_equalp(cl_object x, cl_object y) case t_bignum: case t_ratio: return 0; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return double_fix_compare(fix(x), ecl_short_float(y)) == 0; -#endif case t_singlefloat: return double_fix_compare(fix(x), sf(y)) == 0; case t_doublefloat: @@ -128,9 +124,6 @@ ecl_number_equalp(cl_object x, cl_object y) return _ecl_big_compare(x, y)==0; case t_ratio: return 0; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: -#endif case t_singlefloat: case t_doublefloat: #ifdef ECL_LONG_FLOAT @@ -151,9 +144,6 @@ ecl_number_equalp(cl_object x, cl_object y) case t_ratio: return (ecl_number_equalp(x->ratio.num, y->ratio.num) && ecl_number_equalp(x->ratio.den, y->ratio.den)); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: -#endif case t_singlefloat: case t_doublefloat: #ifdef ECL_LONG_FLOAT @@ -166,11 +156,6 @@ ecl_number_equalp(cl_object x, cl_object y) default: FEwrong_type_nth_arg(@[=], 2, y, @[number]); } -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - dx = ecl_short_float(x); - goto FLOAT; -#endif case t_singlefloat: dx = sf(x); goto FLOAT; @@ -184,10 +169,6 @@ ecl_number_equalp(cl_object x, cl_object y) case t_ratio: x = cl_rational(x); goto BEGIN; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return dx == ecl_short_float(y); -#endif case t_singlefloat: return dx == sf(y); case t_doublefloat: @@ -211,10 +192,6 @@ ecl_number_equalp(cl_object x, cl_object y) case t_ratio: x = cl_rational(x); goto BEGIN; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return dx == ecl_short_float(y); -#endif case t_singlefloat: return dx == sf(y); case t_doublefloat: @@ -239,9 +216,6 @@ ecl_number_equalp(cl_object x, cl_object y) ecl_number_equalp(x->complex.imag, y->complex.imag)); case t_fixnum: case t_bignum: case t_ratio: case t_singlefloat: case t_doublefloat: -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: -#endif #ifdef ECL_LONG_FLOAT case t_longfloat: #endif @@ -293,10 +267,6 @@ ecl_number_compare(cl_object x, cl_object y) x = ecl_times(x, y->ratio.den); y = y->ratio.num; return(ecl_number_compare(x, y)); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return double_fix_compare(ix, ecl_short_float(y)); -#endif case t_singlefloat: return double_fix_compare(ix, sf(y)); case t_doublefloat: @@ -318,9 +288,6 @@ ecl_number_compare(cl_object x, cl_object y) x = ecl_times(x, y->ratio.den); y = y->ratio.num; return(ecl_number_compare(x, y)); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: -#endif case t_singlefloat: case t_doublefloat: #ifdef ECL_LONG_FLOAT @@ -343,9 +310,6 @@ ecl_number_compare(cl_object x, cl_object y) y->ratio.den), ecl_times(y->ratio.num, x->ratio.den))); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: -#endif case t_singlefloat: case t_doublefloat: #ifdef ECL_LONG_FLOAT @@ -356,11 +320,6 @@ ecl_number_compare(cl_object x, cl_object y) default: FEwrong_type_nth_arg(@[<], 2, y, @[real]); } -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - dx = (double)(ecl_short_float(x)); - goto DOUBLEFLOAT0; -#endif case t_singlefloat: dx = (double)(sf(x)); goto DOUBLEFLOAT0; @@ -406,11 +365,6 @@ ecl_number_compare(cl_object x, cl_object y) case t_ratio: x = cl_rational(x); goto BEGIN; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - ldy = ecl_short_float(y); - break; -#endif case t_singlefloat: ldy = sf(y); break; diff --git a/src/c/num_pred.d b/src/c/num_pred.d index 0bd02dd95..121670f1f 100644 --- a/src/c/num_pred.d +++ b/src/c/num_pred.d @@ -29,10 +29,6 @@ ecl_zerop(cl_object x) case t_bignum: case t_ratio: return(0); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return ecl_short_float(x) == 0.0; -#endif case t_singlefloat: return(sf(x) == 0.0); @@ -67,10 +63,6 @@ ecl_plusp(cl_object x) /* INV: rat_den is always positive */ x = x->ratio.num; goto RESTART; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return ecl_short_float(x) > 0.0; -#endif case t_singlefloat: return sf(x) > 0.0; case t_doublefloat: @@ -100,10 +92,6 @@ ecl_minusp(cl_object x) x = x->ratio.num; goto RESTART; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return ecl_short_float(x) < 0; -#endif case t_singlefloat: return sf(x) < 0; @@ -190,10 +178,6 @@ bool ecl_float_infinity_p(cl_object x) { switch (type_of(x)) { -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return !isifinite(ecl_short_float(x)); -#endif case t_singlefloat: return !isfinite(sf(x)); case t_doublefloat: diff --git a/src/c/num_rand.d b/src/c/num_rand.d index 38904dade..447856e90 100644 --- a/src/c/num_rand.d +++ b/src/c/num_rand.d @@ -186,12 +186,6 @@ rando(cl_object x, cl_object rs) case t_bignum: z = random_integer(x, rs->random.value); break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - z = make_shortfloat(ecl_short_float(x) * - (float)generate_double(rs->random.value)); - break; -#endif case t_singlefloat: z = ecl_make_singlefloat(sf(x) * (float)generate_double(rs->random.value)); diff --git a/src/c/num_sfun.d b/src/c/num_sfun.d index c1f52918b..31d49684e 100644 --- a/src/c/num_sfun.d +++ b/src/c/num_sfun.d @@ -128,10 +128,6 @@ ecl_exp(cl_object x) case t_bignum: case t_ratio: output = ecl_make_singlefloat(expf(number_to_float(x))); break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - output = make_shortfloat(expf(ecl_short_float(x))); break; -#endif case t_singlefloat: output = ecl_make_singlefloat(expf(sf(x))); break; case t_doublefloat: @@ -184,10 +180,6 @@ ecl_expt(cl_object x, cl_object y) case t_bignum: case t_ratio: z = MAKE_FIXNUM(1); break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - z = make_shortfloat(1.0); break; -#endif case t_singlefloat: z = ecl_make_singlefloat(1.0); break; case t_doublefloat: @@ -283,14 +275,6 @@ ecl_log1(cl_object x) } break; } -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: { - float f = ecl_short_float(d); - if (f < 0) goto COMPLEX; - output = make_shortfloat(logf(ecl_short_float(x))); - break; - } -#endif case t_singlefloat: { float f = sf(x); if (isnan(f)) goto ISNAN; @@ -351,15 +335,6 @@ ecl_log1p(cl_object x) } case t_bignum: return ecl_log1(ecl_one_plus(x)); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: { - float f = ecl_short_float(x); - if (isnan(f)) goto ISNAN; - if (f < -1) goto COMPLEX; - output = make_shortfloat(log1pf(ecl_short_float(x))); - break; - } -#endif case t_singlefloat: { float f = sf(x); if (isnan(f)) goto ISNAN; @@ -432,10 +407,6 @@ ecl_sqrt(cl_object x) case t_bignum: case t_ratio: z = ecl_make_singlefloat(sqrtf(number_to_float(x))); break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - z = make_shortfloat(sqrtf(ecl_short_float(x))); break;; -#endif case t_singlefloat: z = ecl_make_singlefloat(sqrtf(sf(x))); break; case t_doublefloat: @@ -596,10 +567,6 @@ ecl_sin(cl_object x) case t_bignum: case t_ratio: output = ecl_make_singlefloat(sinf(number_to_float(x))); break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - output = make_shortfloat(sinf(ecl_short_float(x))); break; -#endif case t_singlefloat: output = ecl_make_singlefloat(sinf(sf(x))); break; case t_doublefloat: @@ -644,10 +611,6 @@ ecl_cos(cl_object x) case t_bignum: case t_ratio: output = ecl_make_singlefloat(cosf(number_to_float(x))); break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - output = make_shortfloat(cosf(ecl_short_float(x))); break; -#endif case t_singlefloat: output = ecl_make_singlefloat(cosf(sf(x))); break; case t_doublefloat: @@ -703,10 +666,6 @@ ecl_tan(cl_object x) case t_bignum: case t_ratio: output = ecl_make_singlefloat(safe_tanf(number_to_float(x))); break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - output = make_shortfloat(safe_tanf(ecl_short_float(x))); break; -#endif case t_singlefloat: output = ecl_make_singlefloat(safe_tanf(sf(x))); break; case t_doublefloat: @@ -744,10 +703,6 @@ ecl_sinh(cl_object x) case t_bignum: case t_ratio: output = ecl_make_singlefloat(sinhf(number_to_float(x))); break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - output = make_shortfloat(sinhf(ecl_short_float(x))); break; -#endif case t_singlefloat: output = ecl_make_singlefloat(sinhf(sf(x))); break; case t_doublefloat: @@ -793,10 +748,6 @@ ecl_cosh(cl_object x) case t_bignum: case t_ratio: output = ecl_make_singlefloat(coshf(number_to_float(x))); break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - output = make_shortfloat(coshf(ecl_short_float(x))); break; -#endif case t_singlefloat: output = ecl_make_singlefloat(coshf(sf(x))); break; case t_doublefloat: @@ -842,10 +793,6 @@ ecl_tanh(cl_object x) case t_bignum: case t_ratio: output = ecl_make_singlefloat(tanhf(number_to_float(x))); break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - output = make_shortfloat(tanhf(ecl_short_float(x))); break; -#endif case t_singlefloat: output = ecl_make_singlefloat(tanhf(sf(x))); break; case t_doublefloat: diff --git a/src/c/number.d b/src/c/number.d index e3e508d5a..bc0a3e907 100644 --- a/src/c/number.d +++ b/src/c/number.d @@ -585,11 +585,6 @@ ecl_make_complex(cl_object r, cl_object i) case t_bignum: case t_ratio: break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - r = make_shortfloat((float)ecl_to_double(r)); - break; -#endif case t_singlefloat: r = ecl_make_singlefloat((float)ecl_to_double(r)); break; @@ -606,32 +601,6 @@ ecl_make_complex(cl_object r, cl_object i) goto AGAIN; } break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - switch (ti) { - case t_fixnum: - case t_bignum: - case t_ratio: - i = make_shortfloat((float)ecl_to_double(i)); - case t_shortfloat: - break; - case t_singlefloat: - r = ecl_make_singlefloat((float)ecl_short_float(r)); - break; - case t_doublefloat: - r = ecl_make_doublefloat((double)ecl_short_float(r)); - break; -#ifdef ECL_LONG_FLOAT - case t_longfloat: - r = ecl_make_longfloat((long double)ecl_short_float(r)); - break; -#endif - default: - i = ecl_type_error(@'complex',"imaginary part", i, @'real'); - goto AGAIN; - } - break; -#endif case t_singlefloat: switch (ti) { case t_fixnum: @@ -639,11 +608,6 @@ ecl_make_complex(cl_object r, cl_object i) case t_ratio: i = ecl_make_singlefloat((float)ecl_to_double(i)); break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - i = ecl_make_singlefloat(ecl_short_float(i)); - break; -#endif case t_singlefloat: break; case t_doublefloat: @@ -664,9 +628,6 @@ ecl_make_complex(cl_object r, cl_object i) case t_fixnum: case t_bignum: case t_ratio: -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: -#endif case t_singlefloat: i = ecl_make_doublefloat(ecl_to_double(i)); case t_doublefloat: @@ -825,10 +786,6 @@ ecl_to_double(cl_object x) return _ecl_big_to_double(x); case t_ratio: return ratio_to_double(x->ratio.num, x->ratio.den); -#ifdef ECL_SHORT_FLOAT - case t_singlefloat: - return ecl_short_float(x); -#endif case t_singlefloat: return (double)sf(x); case t_doublefloat: @@ -861,10 +818,6 @@ ecl_to_long_double(cl_object x) } case t_ratio: return ratio_to_long_double(x->ratio.num, x->ratio.den); -#ifdef ECL_SHORT_FLOAT - case t_singlefloat: - return ecl_short_float(x); -#endif case t_singlefloat: return (long double)sf(x); case t_doublefloat: @@ -887,11 +840,6 @@ cl_rational(cl_object x) case t_bignum: case t_ratio: break; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - d = ecl_short_float(x); - goto GO_ON; -#endif case t_singlefloat: d = sf(x); goto GO_ON; diff --git a/src/c/predicate.d b/src/c/predicate.d index 3d8d54efa..268a4883a 100644 --- a/src/c/predicate.d +++ b/src/c/predicate.d @@ -93,9 +93,6 @@ floatp(cl_object x) { cl_type t = type_of(x); return (t == t_singlefloat) || (t == t_doublefloat) -#ifdef ECL_SHORT_FLOAT - || (t == t_shortfloat) -#endif #ifdef ECL_LONG_FLOAT || (t == t_longfloat) #endif @@ -284,10 +281,6 @@ ecl_eql(cl_object x, cl_object y) case t_ratio: return (ecl_eql(x->ratio.num, y->ratio.num) && ecl_eql(x->ratio.den, y->ratio.den)); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - FLOAT_EQL(ecl_short_float(x), ecl_short_float(y), float); -#endif case t_singlefloat: FLOAT_EQL(sf(x), sf(y), float); case t_doublefloat: @@ -340,12 +333,6 @@ BEGIN: case t_ratio: return (tx == ty) && ecl_eql(x->ratio.num, y->ratio.num) && ecl_eql(x->ratio.den, y->ratio.den); -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: { - if (tx != ty) return 0; - FLOAT_EQL(ecl_short_float(x), ecl_short_float(y), float); - } -#endif case t_singlefloat: { if (tx != ty) return 0; FLOAT_EQL(sf(x), sf(y), float); @@ -425,9 +412,6 @@ BEGIN: case t_fixnum: case t_bignum: case t_ratio: -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: -#endif case t_singlefloat: case t_doublefloat: #ifdef ECL_LONG_FLOAT diff --git a/src/c/print.d b/src/c/print.d index 89d7a9abc..524d333a6 100644 --- a/src/c/print.d +++ b/src/c/print.d @@ -1108,24 +1108,11 @@ si_write_ugly_object(cl_object x, cl_object stream) ecl_bds_unwind1(env); break; } -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - r = ecl_symbol_value(@'*read-default-float-format*'); - write_double(ecl_short_float(x), (r == @'short-float')? 0 : 'f', - FLT_SIG, stream, x); - break; - case t_singlefloat: - r = ecl_symbol_value(@'*read-default-float-format*'); - write_double(sf(x), (r == @'single-float')? 0 : 's', - FLT_SIG, stream, x); - break; -#else case t_singlefloat: r = ecl_symbol_value(@'*read-default-float-format*'); write_double(sf(x), (r == @'single-float' || r == @'short-float')? 0 : 's', FLT_SIG, stream, x); break; -#endif #ifdef ECL_LONG_FLOAT case t_doublefloat: r = ecl_symbol_value(@'*read-default-float-format*'); diff --git a/src/c/read.d b/src/c/read.d index eb888e2b9..97b82a2c0 100644 --- a/src/c/read.d +++ b/src/c/read.d @@ -562,9 +562,6 @@ ecl_parse_number(cl_object str, cl_index start, cl_index end, exp_marker = ecl_current_read_default_float_format(); goto MAKE_FLOAT; case 's': case 'S': -#ifdef ECL_SHORT_FLOAT - output = make_shortfloat(d); -#endif case 'f': case 'F': output = ecl_make_singlefloat(d); break; diff --git a/src/c/typespec.d b/src/c/typespec.d index f2c5e0cd6..fd27f74ee 100644 --- a/src/c/typespec.d +++ b/src/c/typespec.d @@ -98,10 +98,6 @@ ecl_type_to_symbol(cl_type t) return @'bignum'; case t_ratio: return @'ratio'; -#ifdef ECL_SHORT_FLOAT - case t_shortfloat: - return @'short-float'; -#endif case t_singlefloat: return @'single-float'; case t_doublefloat: diff --git a/src/cmp/cmparray.lsp b/src/cmp/cmparray.lsp index 08777e46a..44c5ea5d6 100644 --- a/src/cmp/cmparray.lsp +++ b/src/cmp/cmparray.lsp @@ -201,20 +201,18 @@ ,@(when (policy-type-assertions env) `((check-arrayp ,a) (check-expected-rank ,a ,expected-rank))) - ,@(loop with last-dim = nil - for i from 0 + ,@(loop for i from 0 for l in indices for index in indices for dim-var in dim-names - when last-dim + when (plusp i) collect `(setf %output-var - (the ext:array-index (* %output-var ,last-dim))) + (the ext:array-index (* %output-var ,dim-var))) collect `(let ((%ndx-var ,index)) (declare (ext:array-index %ndx-var)) ,(and check `(check-index-in-bounds ,a %ndx-var ,dim-var)) (setf %output-var - (the ext:array-index (+ %output-var %ndx-var)))) - do (setf last-dim dim-var)) + (the ext:array-index (+ %output-var %ndx-var))))) %output-var)))) ;(trace c::expand-row-major-index c::expand-aset c::expand-aref) diff --git a/src/cmp/cmpc-inliner.lsp b/src/cmp/cmpc-inliner.lsp index 5218226ed..d2a9be114 100644 --- a/src/cmp/cmpc-inliner.lsp +++ b/src/cmp/cmpc-inliner.lsp @@ -105,8 +105,7 @@ output)) (defun to-fixnum-float-type (type) - (dolist (i '(FIXNUM DOUBLE-FLOAT SINGLE-FLOAT - #+short-float SHORT-FLOAT #+long-float LONG-FLOAT) + (dolist (i '(FIXNUM DOUBLE-FLOAT SINGLE-FLOAT #+long-float LONG-FLOAT) nil) (when (type>= i type) (return i)))) @@ -121,9 +120,6 @@ 'DOUBLE-FLOAT) ((or (eq t1 'SINGLE-FLOAT) (eq t2 'SINGLE-FLOAT)) 'SINGLE-FLOAT) - #+short-float - ((or (eq t1 'SHORT-FLOAT) (eq t2 'SHORT-FLOAT)) - 'SHORT-FLOAT) (T 'FIXNUM))) diff --git a/src/cmp/cmpnum.lsp b/src/cmp/cmpnum.lsp index 657f575e6..3d1ce3513 100644 --- a/src/cmp/cmpnum.lsp +++ b/src/cmp/cmpnum.lsp @@ -68,12 +68,10 @@ (output nil) (default (if only-real 'REAL 'NUMBER)) (types-list (if only-real - '(FIXNUM INTEGER RATIONAL - #+short-float SHORT-FLOAT SINGLE-FLOAT + '(FIXNUM INTEGER RATIONAL SINGLE-FLOAT DOUBLE-FLOAT #+long-float LONG-FLOAT FLOAT REAL NUMBER) - '(FIXNUM INTEGER RATIONAL - #+short-float SHORT-FLOAT SINGLE-FLOAT + '(FIXNUM INTEGER RATIONAL SINGLE-FLOAT DOUBLE-FLOAT #+long-float LONG-FLOAT FLOAT REAL)))) (dolist (i types-list (values (if (and t1-eq t2-eq output) output default) diff --git a/src/cmp/cmpopt.lsp b/src/cmp/cmpopt.lsp index 15f4d2661..826fe7a36 100644 --- a/src/cmp/cmpopt.lsp +++ b/src/cmp/cmpopt.lsp @@ -126,8 +126,7 @@ ;; ;; (INTEGER * *), etc ((member first '(INTEGER RATIONAL FLOAT REAL SINGLE-FLOAT - DOUBLE-FLOAT #+long-float LONG-FLOAT - #+short-float SHORT-FLOAT)) + DOUBLE-FLOAT #+long-float LONG-FLOAT)) (let ((var (gensym))) ;; Small optimization: it is easier to check for fixnum ;; than for integer. Use it when possible. @@ -292,8 +291,7 @@ ;; does not match. However, if safety settings are low, we ;; skip the interval test. ((member first '(INTEGER RATIONAL FLOAT REAL SINGLE-FLOAT - DOUBLE-FLOAT #+long-float LONG-FLOAT - #+short-float SHORT-FLOAT)) + DOUBLE-FLOAT #+long-float LONG-FLOAT)) (let ((unchecked (expand-coerce form value `',first env))) (if (policy-assume-no-errors) unchecked diff --git a/src/cmp/sysfun.lsp b/src/cmp/sysfun.lsp index a4a34a070..82c3f56b2 100644 --- a/src/cmp/sysfun.lsp +++ b/src/cmp/sysfun.lsp @@ -781,10 +781,7 @@ (def-inline shift<< :always (fixnum fixnum) :fixnum "((#0) << (#1))") -#-short-float (def-inline short-float-p :always (t) :bool "@0;ECL_SINGLE_FLOAT_P(#0)") -#+short-float -(def-inline short-float-p :always (t) :bool "type_of(#0) == t_short_float") (def-inline single-float-p :always (t) :bool "@0;ECL_SINGLE_FLOAT_P(#0)") diff --git a/src/h/external.h b/src/h/external.h index 81cec7572..2d3894d91 100755 --- a/src/h/external.h +++ b/src/h/external.h @@ -1103,10 +1103,6 @@ extern ECL_API cl_object cl_rational(cl_object x); #define cl_rationalize cl_rational extern ECL_API double ecl_to_double(cl_object x); #define number_to_float(x) ((float)ecl_to_double(x)) -#ifdef ECL_SHORT_FLOAT -extern ECL_API cl_object ecl_make_shortfloat(float f); -extern ECL_API float ecl_short_float(cl_object o); -#endif #ifdef ECL_LONG_FLOAT extern ECL_API long double ecl_to_long_double(cl_object x); extern ECL_API cl_object ecl_make_longfloat(long double f); diff --git a/src/h/object.h b/src/h/object.h index 66240dd81..494037ed2 100644 --- a/src/h/object.h +++ b/src/h/object.h @@ -31,9 +31,6 @@ typedef int bool; #endif typedef unsigned char byte; -#ifdef ECL_SHORT_FLOAT -#undef ECL_SHORT_FLOAT -#endif /* #define ECL_EXTERNALIZABLE */ /* diff --git a/src/lsp/predlib.lsp b/src/lsp/predlib.lsp index ee0c7d6bd..1f717fdca 100644 --- a/src/lsp/predlib.lsp +++ b/src/lsp/predlib.lsp @@ -467,9 +467,6 @@ Returns T if X belongs to TYPE; NIL otherwise." #+long-float (LONG-FLOAT (and (eq (type-of object) 'LONG-FLOAT) (in-interval-p object i))) - #+short-float - (SHORT-FLOAT - (and (eq (type-of object) 'SHORT-FLOAT) (in-interval-p object i))) (COMPLEX (and (complexp object) (or (null i) @@ -1103,20 +1100,17 @@ if not possible." tag)) #+(or) (case real-type - ((SINGLE-FLOAT DOUBLE-FLOAT INTEGER RATIO #+long-float LONG-FLOAT - #+short-float SHORTF-FLOAT) + ((SINGLE-FLOAT DOUBLE-FLOAT INTEGER RATIO #+long-float LONG-FLOAT) (let ((tag (new-type-tag))) (push-type `(COMPLEX ,real-type) tag) tag)) ((RATIONAL) (canonical-type '(OR (COMPLEX INTEGER) (COMPLEX RATIO)))) ((FLOAT) (canonical-type '(OR (COMPLEX SINGLE-FLOAT) (COMPLEX DOUBLE-FLOAT) - #+long-float (COMPLEX LONG-FLOAT) - #+short-float (COMPLEX SHORT-FLOAT)))) + #+long-float (COMPLEX LONG-FLOAT)))) ((* NIL REAL) (canonical-type '(OR (COMPLEX INTEGER) (COMPLEX RATIO) (COMPLEX SINGLE-FLOAT) (COMPLEX DOUBLE-FLOAT) #+long-float (COMPLEX LONG-FLOAT) - #+short-float (COMPLEX SHORT-FLOAT) ))) (otherwise (canonical-complex-type (upgraded-complex-part-type real-type))))) @@ -1164,8 +1158,6 @@ if not possible." (FUNCTION (OR COMPILED-FUNCTION GENERIC-FUNCTION)) (INTEGER (INTEGER * *)) - #+short-float - (SHORT-FLOAT (SHORT-FLOAT * *)) (SINGLE-FLOAT (SINGLE-FLOAT * *)) (DOUBLE-FLOAT (DOUBLE-FLOAT * *)) #+long-float @@ -1174,10 +1166,8 @@ if not possible." (RATIONAL (OR INTEGER RATIO)) (FLOAT (OR SINGLE-FLOAT DOUBLE-FLOAT - #+long-float LONG-FLOAT - #+short-float SHORT-FLOAT)) + #+long-float LONG-FLOAT)) (REAL (OR INTEGER SINGLE-FLOAT DOUBLE-FLOAT - #+short-float SHORT-FLOAT #+long-float LONG-FLOAT RATIO)) (COMPLEX (COMPLEX REAL)) @@ -1318,14 +1308,11 @@ if not possible." (NOT (lognot (canonical-type (second type)))) ((EQL MEMBER) (apply #'logior (mapcar #'register-member-type (rest type)))) (SATISFIES (register-satisfies-type type)) - ((INTEGER SINGLE-FLOAT DOUBLE-FLOAT RATIO - #+long-float LONG-FLOAT #+short-float SHORT-FLOAT) + ((INTEGER SINGLE-FLOAT DOUBLE-FLOAT RATIO #+long-float LONG-FLOAT) (register-interval-type type)) ((FLOAT) (canonical-type `(OR (SINGLE-FLOAT ,@(rest type)) (DOUBLE-FLOAT ,@(rest type)) - #+short-float - (SHORT-FLOAT ,@(rest type)) #+long-float (LONG-FLOAT ,@(rest type))))) ((REAL) @@ -1333,8 +1320,6 @@ if not possible." (RATIO ,@(rest type)) (SINGLE-FLOAT ,@(rest type)) (DOUBLE-FLOAT ,@(rest type)) - #+short-float - (SHORT-FLOAT ,@(rest type)) #+long-float (LONG-FLOAT ,@(rest type))))) ((RATIONAL)