Commit 6ecd2473 authored by Daniel Kochmański's avatar Daniel Kochmański

complex float: add types and structures to core runtime

t_csfloat - ecl_csfloat,
t_cdfloat - ecl_cdfloat,
t_clfloat - ecl_clfloat.
parent e7725d4b
...@@ -413,6 +413,11 @@ static printer dispatch[FREE+1] = { ...@@ -413,6 +413,11 @@ static printer dispatch[FREE+1] = {
write_float, /* t_longfloat */ write_float, /* t_longfloat */
#endif #endif
write_complex, /* t_complex */ write_complex, /* t_complex */
#ifdef ECL_COMPLEX_FLOAT
write_illegal, /* t_csfloat */
write_illegal, /* t_cdfloat */
write_illegal, /* t_clfloat */
#endif
_ecl_write_symbol, /* t_symbol */ _ecl_write_symbol, /* t_symbol */
write_package, /* t_package */ write_package, /* t_package */
write_hashtable, /* t_hashtable */ write_hashtable, /* t_hashtable */
......
...@@ -41,7 +41,7 @@ typedef enum { ...@@ -41,7 +41,7 @@ typedef enum {
t_start = 0, t_start = 0,
t_list = 1, t_list = 1,
/* The most specific numeric types come first. Assumed by /* The most specific numeric types come first. Assumed by
some routines, like cl_expt */ some routines, like cl_expt. See ANSI 12.1.1.2. */
t_character = 2, /* immediate character */ t_character = 2, /* immediate character */
t_fixnum = 3, /* immediate fixnum */ t_fixnum = 3, /* immediate fixnum */
t_bignum = 4, t_bignum = 4,
...@@ -53,6 +53,11 @@ typedef enum { ...@@ -53,6 +53,11 @@ typedef enum {
t_longfloat, t_longfloat,
#endif #endif
t_complex, t_complex,
#ifdef ECL_COMPLEX_FLOAT
t_csfloat,
t_cdfloat,
t_clfloat,
#endif
t_symbol, t_symbol,
t_package, t_package,
t_hashtable, t_hashtable,
...@@ -231,6 +236,26 @@ struct ecl_complex { ...@@ -231,6 +236,26 @@ struct ecl_complex {
cl_object imag; /* imaginary part, must be a number */ cl_object imag; /* imaginary part, must be a number */
}; };
#ifdef ECL_COMPLEX_FLOAT
struct ecl_csfloat {
_ECL_HDR;
float _Complex value;
};
#define ecl_csfloat(o) ((o)->csfloat.value)
struct ecl_cdfloat {
_ECL_HDR;
double _Complex value;
};
#define ecl_cdfloat(o) ((o)->cdfloat.value)
struct ecl_clfloat {
_ECL_HDR;
long double _Complex value;
};
#define ecl_clfloat(o) ((o)->clfloat.value)
#endif
enum ecl_stype { /* symbol type */ enum ecl_stype { /* symbol type */
ecl_stp_ordinary = 0, ecl_stp_ordinary = 0,
ecl_stp_constant = 1, ecl_stp_constant = 1,
...@@ -1031,6 +1056,11 @@ union cl_lispunion { ...@@ -1031,6 +1056,11 @@ union cl_lispunion {
struct ecl_long_float longfloat; /* long-float */ struct ecl_long_float longfloat; /* long-float */
#endif #endif
struct ecl_complex complex; /* complex number */ struct ecl_complex complex; /* complex number */
#ifdef ECL_COMPLEX_FLOAT
struct ecl_csfloat csfloat; /* complex single float */
struct ecl_cdfloat cdfloat; /* complex double float */
struct ecl_clfloat clfloat; /* complex long float */
#endif
struct ecl_symbol symbol; /* symbol */ struct ecl_symbol symbol; /* symbol */
struct ecl_package pack; /* package */ struct ecl_package pack; /* package */
struct ecl_hashtable hash; /* hash table */ struct ecl_hashtable hash; /* hash table */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment