work on machines with floating-point alignment constraints.
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/array.c,v 9.43 1991/10/14 23:51:19 thanos Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/array.c,v 9.44 1991/12/20 22:48:36 cph Exp $
-Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
+Copyright (c) 1987-91 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
\f
SCHEME_OBJECT
allocate_array (length)
- fast long length;
+ long length;
{
+#if (REAL_IS_DEFINED_DOUBLE == 0)
+
fast SCHEME_OBJECT result =
(allocate_non_marked_vector
(TC_NON_MARKED_VECTOR, ((length * REAL_SIZE) + 1), true));
FAST_MEMORY_SET (result, 1, length);
return (result);
+
+#else /* (REAL_IS_DEFINED_DOUBLE != 0) */
+
+ long n_words = (length * DOUBLE_SIZE);
+ ALIGN_FLOAT (Free);
+ Primitive_GC_If_Needed (n_words + 1);
+ {
+ SCHEME_OBJECT result = (MAKE_POINTER_OBJECT (TC_BIG_FLONUM, (Free)));
+ (*Free++) = (MAKE_OBJECT (TC_MANIFEST_NM_VECTOR, n_words));
+ Free += n_words;
+ return (result);
+ }
+
+#endif /* (REAL_IS_DEFINED_DOUBLE != 0) */
}
DEFINE_PRIMITIVE ("VECTOR->ARRAY", Prim_vector_to_array, 1, 1, 0)
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/array.h,v 9.31 1989/09/20 23:05:33 cph Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/array.h,v 9.32 1991/12/20 22:48:56 cph Exp $
-Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
+Copyright (c) 1987-91 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
#define FLOAT_SIZE (BYTES_TO_WORDS (sizeof (float)))
#define DOUBLE_SIZE (BYTES_TO_WORDS (sizeof (double)))
+#if (REAL_IS_DEFINED_DOUBLE == 0)
+
/* Scheme_Arrays are implemented as NON_MARKED_VECTOR. */
#define ARRAY_P NON_MARKED_VECTOR_P
#define ARRAY_LENGTH(array) ((long) (FAST_MEMORY_REF ((array), 1)))
#define ARRAY_CONTENTS(array) ((REAL *) (MEMORY_LOC (array, 2)))
+#else /* (REAL_IS_DEFINED_DOUBLE != 0) */
+
+/* Scheme_Arrays are implemented as flonum vectors.
+ This is required to get alignment to work right on RISC machines. */
+
+#define ARRAY_P FLONUM_P
+#define ARRAY_LENGTH(array) ((VECTOR_LENGTH (array)) / DOUBLE_SIZE)
+#define ARRAY_CONTENTS(array) ((REAL *) (MEMORY_LOC (array, 1)))
+
+#endif /* (REAL_IS_DEFINED_DOUBLE != 0) */
+
extern SCHEME_OBJECT allocate_array ();
extern void C_Array_Find_Min_Max ();
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/fft.c,v 9.29 1990/01/02 18:35:22 pas Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/fft.c,v 9.30 1991/12/20 22:49:07 cph Exp $
-Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
+Copyright (c) 1987-91 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
if ( (i % 2) == 1) error_bad_range_arg (1);
i=i/2; }
+#if (REAL_IS_DEFINED_DOUBLE != 0)
+ ALIGN_FLOAT (Free);
+ Free += 1;
+#endif
Primitive_GC_If_Needed(Length*REAL_SIZE + ((max(nrows,ncols))*3*REAL_SIZE));
Work_Here = (REAL *) Free;
g1 = Work_Here;
for (nrows_power=0, i=nrows; i>1; nrows_power++) { /* FIND/CHECK POWERS OF ROWS */
if ( (i % 2) == 1) error_bad_range_arg (2);
i=i/2; }
+#if (REAL_IS_DEFINED_DOUBLE != 0)
+ ALIGN_FLOAT (Free);
+ Free += 1;
+#endif
Primitive_GC_If_Needed(nrows*3*REAL_SIZE);
Work_Here = (REAL *) Free;
g1 = Work_Here;
for (ndeps_power=0, l=ndeps; l>1; ndeps_power++) { /* FIND/CHECK POWER OF NDEPS */
if ( (l % 2) == 1) error_bad_range_arg (2);
l=l/2; }
+#if (REAL_IS_DEFINED_DOUBLE != 0)
+ ALIGN_FLOAT (Free);
+ Free += 1;
+#endif
Primitive_GC_If_Needed(ndeps*3*REAL_SIZE);
Work_Here = (REAL *) Free;
g1 = Work_Here;
f2 = ARRAY_CONTENTS(ARG_REF(3));
if (f1==f2) error_wrong_type_arg(2);
+#if (REAL_IS_DEFINED_DOUBLE != 0)
+ ALIGN_FLOAT (Free);
+ Free += 1;
+#endif
Primitive_GC_If_Needed(length*3*REAL_SIZE);
Work_Here = (REAL *) Free;
g1 = Work_Here;
L = 1<<log2_L; /* length of intermediate computation arrays */
maxMN = (((M)<(N)) ? (N) : (M)); /* length of czt tables = maximum(M,N) */
+#if (REAL_IS_DEFINED_DOUBLE != 0)
+ ALIGN_FLOAT (Free);
+ Free += 1;
+#endif
Primitive_GC_If_Needed( ((7*L) + (2*maxMN)) * REAL_SIZE);
g1 = (REAL *) Free;
g2 = g1 + L;
/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/image.c,v 9.31 1990/01/15 18:09:34 pas Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/image.c,v 9.32 1991/12/20 22:49:23 cph Exp $
-Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
+Copyright (c) 1987-91 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
(Array [array_index + m]) = ((REAL) (read_2bint (fp)));
}
/* CTSCAN images are upside down */
+#if (REAL_IS_DEFINED_DOUBLE != 0)
+ ALIGN_FLOAT (Free);
+ Free += 1;
+#endif
Primitive_GC_If_Needed (512 * REAL_SIZE);
Image_Mirror_Upside_Down (Array, nrows, ncols, ((REAL *) Free));
if ((fclose (fp)) != 0)
Array = (ARRAY_CONTENTS (Parray));
}
Length = (nrows * ncols);
+#if (REAL_IS_DEFINED_DOUBLE != 0)
+ ALIGN_FLOAT (Free);
+ Free += 1;
+#endif
Primitive_GC_If_Needed (Length * REAL_SIZE);
{
REAL * Temp_Array = ((REAL *) Free);
Array = (ARRAY_CONTENTS (Parray));
}
Length = (nrows * ncols);
+#if (REAL_IS_DEFINED_DOUBLE != 0)
+ ALIGN_FLOAT (Free);
+ Free += 1;
+#endif
Primitive_GC_If_Needed (Length * REAL_SIZE);
{
REAL * Temp_Array = ((REAL *) Free);