Le 06/05/2021 à 21:41, bill rowe a écrit :@jacob: thanks for the pointer.
I am used to my LCC port handling things like
void foo(uint16_t){}
foo(40*40)
at compile time but something i've done is now leaving it for a run-time multiply.
The possibly related change is to make my int's 8 bits rather than 16. Could that affect it?
If I explicitly say foo( (uint16_t)40*40 )
I do get the compile time calculation so it's clearly related to the int width.
You have to add the compile time calculation to simp.c in function
simplify. There is no ADD+C operation since all is done in integers that
are wider than a character. But since I do not klnow how you have done
your stuff, I can't tell you more
jacob
I am used to my LCC port handling things like
void foo(uint16_t){}
foo(40*40)
at compile time but something i've done is now leaving it for a run-time multiply.
The possibly related change is to make my int's 8 bits rather than 16. Could that affect it?
If I explicitly say foo( (uint16_t)40*40 )
I do get the compile time calculation so it's clearly related to the int width.
I am used to my LCC port handling things like
void foo(uint16_t){}
foo(40*40)
at compile time but something i've done is now leaving it for a run-time multiply.
The possibly related change is to make my int's 8 bits rather than 16. Could that affect it?
If I explicitly say foo( (uint16_t)40*40 )
I do get the compile time calculation so it's clearly related to the int width.
C standard requires int to be at least 16 bits.Anyway, thanks for pointing that out. I have a working port with 16 bit ints, my 8 bit variant is useful where i'm doing a lot of character-sized work and the compiler-generated promotions add notably to the output.
There's nothing wrong with a non-conforming C-like implementation if
that's what you need. I just wanted to make sure you're aware of it.
(And LCC might have some implicit assumptions built into it, perhaps
related to the fact that standard C has no arithmetic operations on
types narrower than int.)
--
Keith Thompson (The_Other_Keith) Keith.S.T...@gmail.com
Working, but not speaking, for Philips Healthcare
void Void(void) { Void(); } /* The recursive call of the void */
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 399 |
Nodes: | 16 (0 / 16) |
Uptime: | 29:23:08 |
Calls: | 8,327 |
Calls today: | 4 |
Files: | 13,153 |
Messages: | 5,890,081 |
Posted today: | 1 |