Add a special variable to control printing of SSE packs.

Valid values: NIL, :int, :float, :double.

Non-NIL values override the type tag carried by the pack.
This commit is contained in:
Alexander Gavrilov 2010-09-03 13:42:09 +04:00 committed by Juan Jose Garcia Ripoll
parent 03049ee7e2
commit 1c3d729ef5
3 changed files with 10 additions and 0 deletions

View file

@ -1073,6 +1073,14 @@ static void
write_sse_pack(cl_object x, cl_object stream)
{
int i;
cl_elttype etype = x->sse.elttype;
cl_object mode = ecl_symbol_value(@'ext::*sse-pack-print-mode*');
if (mode != Cnil) {
if (mode == @':float') etype = aet_sf;
else if (mode == @':double') etype = aet_df;
else etype = aet_b8;
}
switch (x->sse.elttype) {
case aet_sf:

View file

@ -1940,6 +1940,7 @@ cl_symbols[] = {
{EXT_ "FLOAT-SSE-PACK", EXT_ORDINARY, NULL, -1, OBJNULL},
{EXT_ "DOUBLE-SSE-PACK", EXT_ORDINARY, NULL, -1, OBJNULL},
{EXT_ "SSE-PACK-ELEMENT-TYPE", EXT_ORDINARY, si_sse_pack_element_type, 1, OBJNULL},
{EXT_ "*SSE-PACK-PRINT-MODE*", EXT_SPECIAL, NULL, -1, Cnil},
#endif
{EXT_ "UNIX-SIGNAL-RECEIVED", EXT_ORDINARY, NULL, -1, OBJNULL},

View file

@ -1940,6 +1940,7 @@ cl_symbols[] = {
{EXT_ "FLOAT-SSE-PACK",NULL},
{EXT_ "DOUBLE-SSE-PACK",NULL},
{EXT_ "SSE-PACK-ELEMENT-TYPE","si_sse_pack_element_type"},
{EXT_ "*SSE-PACK-PRINT-MODE*",NULL},
#endif
{EXT_ "UNIX-SIGNAL-RECEIVED",NULL},