SmallerC: generate smaller & faster code; bugfixes
Improvements:
- use registers more efficiently
- eliminate some register copies and stack manipulations
- promote left operands to right immediate operands
- improve simple assignments to auto/static vars
- use bltz, blez, bgtz, bgez
- change mul/divu (by powers of 2) to sll/srl/and
- use seb, seh for sign extension instead of sll/sra
- overall generate a bit tighter, faster and more readable asm code
Fixes:
- >>= should be unsigned when the left operand is unsigned int.
The right operand isn't important here.
- very subtle bug in e.g. void f(){int a; &a+1;/*wrong value of &a+1*/}
Other:
- include stdarg.c and skeleton.c in /share/example/Makefile
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
|
||||
all: ashello echo chello
|
||||
all: ashello echo chello stdarg skeleton
|
||||
|
||||
ashello: ashello.o
|
||||
$(LD) ashello.o -o $@
|
||||
@@ -10,5 +10,11 @@ chello: chello.o
|
||||
echo: echo.o
|
||||
$(LD) $@.o -o $@
|
||||
|
||||
stdarg: stdarg.o
|
||||
$(CC) stdarg.o -o $@
|
||||
|
||||
skeleton: skeleton.o
|
||||
$(CC) skeleton.o -o $@
|
||||
|
||||
clean:
|
||||
rm -f *.o ashello echo chello *.dis *~
|
||||
rm -f *.o ashello echo chello stdarg skeleton *.dis *~
|
||||
|
||||
Reference in New Issue
Block a user