Dear Philipp,

>> I'm sure you are right, because "char" is often used to store "boolean"
>> values or for small cycles. But the real question is: are those values
>> used as operands in multiplications?
>> If you use the byteXbyte product as a building block for some more
>> complex
>> mathematical function, you usually have "random" bytes to handle. If you
>> use it to access elements of a bi-dimensional array A[x+ROWLEN*y], then
>> the result must be small... and so must be the two operands.

I wrote a small patch for 32x32->32 multiplication using both 8x8->16 and
16x16->16 product, this should speed up the Z80 implementation a lot...
https://sourceforge.net/support/tracker.php?aid=2762462

> I finally found some useful statistics: In "The New C Standard - An
> Economical and Cultural Commentary", on page 1144, see figures 1143.2.
> It has info on how common char values are when used as operands to *
> and /. Unfortunately it's not much, but it might be insightful.

Unfortunately this is mainly about constants used in programs, and this
should influence mainly the compiler part and marginally the library. The
compiler should optimise r=a*0+b*1/8+2*c/1 with r=(b>>3)+(c<<1) at
comile-time. The library can not check for too many special cases at
run-time...
I tried to add such a special handling to div/mod code, because I think
that most of the times modulus is called to convert integers to strings
(base 10 or 16...) with a small divisor.
The result obviously is that code size increase!
https://sourceforge.net/support/tracker.php?aid=2764475

One question, is it possible to have some functions with a different
calling convention? Using registers to pass parameters, should obviously
be very interesting for small library functions, but also the simple
"stack clean-up by the callee" can (sometime) avoid a lot of coding both
on the caller and on the callee side.

Regards,
Marco

-- 
http://bodrato.it/


------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to