Hello,

It could be useful in bit packed structure, but that implies the absence of any padding bits...

I cant think of a use case outside of structures.


BTW, Cant you achieve arbitrary size integers with a bitfield structure?

https://stackoverflow.com/questions/3917425/how-to-implement-unsigned-33-bit-integer-type

|struct uint33_t { uint64_t value : 33; }; |

Admittedly I believe your solution would make the syntax a bit less cumbersome.

Sebastien

Le 12/10/2020 à 17:25, Philipp Klaus Krause a écrit :
I wonder how useful arbitrary-width integers would be for SDCC users.

_ExtInt(N) would be an N-bit integer type.

E.e. one could have an unsigned 24-bit integer (in 3 bytes) via

unsigned _ExtInt(24) i;

or a 23-bit type (3 bytes in memory, 23 value bits and 1 padding bit):

unsigned _ExtInt(23) i;

If such a type is introduced, would you prefer this type to exempt from
integer promotion?

Philipp


_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to