Hello, On Wed, Jun 05, 2002 at 06:31:23PM +0100, Alan Cox wrote: > I've been pondering the question of how to make bcc fit. One way is a > better optimiser, but the other approach that might be easier to > implement would be an optional 'size before speed' piece of code. > > Take the entire existing tree, scan it for identical sequences of asm > instructions where the stack is balanced (ie equal push/pop and never > pops below the level on entry) generate a library of them and then > replace those sequences with calls if bcc is called with some suitable > option to run the replacer. We'd trade a few clock cycles for bytes each > time the substitution occurred. > > That way bcc would probably actually fit > As an interim approach, you could try just #ifdef-ing out the floating point support. I just ran a quick test of simply removing floatop.c from the dependencies and #ifdef'ing out the necessary code blocks in genloads.c, glogcode.c, softop.c, hardop.c, and assign.c. It buids, and at least the preprocessor works with elksemu. I'm not sure what compiler misbehavior might result if any floating point code is encountered though. [mjn3@mars bcc]$ file bcc bcc-cc1 bcc: Linux-8086 executable bcc-cc1: Linux-8086 executable [mjn3@mars bcc]$ size86 bcc bcc-cc1 text data bss dec hex filename 11776 1328 744 13848 3618 bcc 65424 5896 8848 80168 13928 bcc-cc1 This is for bcc from dev86-0.16.3, but with some additional tweaks to the preprocessor to support "#elif" and non-ansi token pasting macros, as well as enabling the "asm" statement outside of a function so that I could do things like the following (bcc patch for this is attached). I meant to post the patch sometime before this, but I've been pretty busy with some uClibc projects. Manuel /* Put this immediately before the function being aliased. */ #define __BCC_ALIAS(X,Y) asm("export _" "X" "\n_" "X" " = _" "Y") #ifdef __AS386_16__ #define __BCC_CTOR(X) asm( \ " loc 1\n" /* Make sure the pointer is in the correct segment */ \ "auto_func:\n" /* Label for bcc -M to work. */ \ ".word _" "X" "\n" /* Pointer to the autorun function */ \ ".word no_op\n" /* Space filler cause segs are padded to 4 bytes. */ \ ".text\n" /* So the function after is also in the correct seg. */ \ ) #endif #ifdef __AS386_32__ #define __BCC_CTOR(X) asm( \ " loc 1\n" /* Make sure the pointer is in the correct segment */ \ "auto_func:\n" /* Label for bcc -M to work. */ \ ".long _" "X" "\n" /* Pointer to the autorun function */ \ ".text\n" /* So the function after is also in the correct seg. */ \ ) #endif