diff options
author | Robert de Bath <rdebath@poboxes.com> | 1998-07-01 01:00:00 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2013-10-23 23:40:31 +0200 |
commit | ec5f28e3f1400b5dacb88eda2d9db472a20b4349 (patch) | |
tree | b3215b2306709d0412fd7845c78ca63ccaa2e29b /bcc/genloads.c | |
parent | 2f828530e36a02c5b4c534e42ab812370c2bf7d9 (diff) | |
download | dev86-ec5f28e3f1400b5dacb88eda2d9db472a20b4349.tar.gz |
Import Dev86src-0.14.3.tar.gzv0.14.3
Diffstat (limited to 'bcc/genloads.c')
-rw-r--r-- | bcc/genloads.c | 58 |
1 files changed, 53 insertions, 5 deletions
diff --git a/bcc/genloads.c b/bcc/genloads.c index e90dd5d..b39856e 100644 --- a/bcc/genloads.c +++ b/bcc/genloads.c @@ -348,9 +348,24 @@ store_pt targreg; return; if (source->storage == CONSTANT) { - /* XXX - more for non-386 */ - loadconst(((offset_T *) source->offset.offd)[0], DREG); - loadconst(((offset_T *) source->offset.offd)[1], targreg); + if (i386_32) + { + loadconst(((offset_T *) source->offset.offd)[0], DREG); + loadconst(((offset_T *) source->offset.offd)[1], targreg&~DREG); + } + else /* XXX - more for non-386 */ + { + int regs, i, off=1; + loadconst(((unsigned short *) source->offset.offd)[0], DREG); + regs = (targreg&~DREG); + for(i=1; i; i<<=1) + { + if( regs&i ) + loadconst( + ((unsigned short *) source->offset.offd)[off++], + i); + } + } } else { @@ -369,7 +384,28 @@ store_pt targreg; float val; val = *source->offset.offd; - loadconst(((offset_T *) &val)[0], targreg); +#ifdef I80386 + if (i386_32) + loadconst(((offset_T *) &val)[0], targreg); /* XXX 386 */ + else +#endif + { + loadconst(((unsigned short *) &val)[0], DREG); + loadconst(((unsigned short *) &val)[1], targreg&~DREG); + } + } + else if (!i386_32 && source->type->scalar & FLOAT) + { + /* Treat a float just like a long ... */ + if (source->indcount == 0) + { + if (source->storage != (store_t) targreg) + transfer(source, targreg); + if (source->offset.offi != 0) + bugerror("loading direct float with offset not implemented"); + } + else + loadlongindirect(source, targreg); } else if (source->indcount == 0 && source->storage != CONSTANT) loadadr(source, targreg); @@ -937,7 +973,19 @@ store_pt reg; break; #endif default: - outstr(badregstr); + { int i; + if (reg) + for(i=1; i; i<<=1) + { + if( reg&i ) + { + outregname(i); + outstr(" "); + } + } + else + outstr(badregstr); + } break; } } |