List of platforms supported by the C standard

后端 未结 7 2071
粉色の甜心
粉色の甜心 2020-12-01 06:34

Does anyone know of any platforms supported by the C standard, for which there is still active development work, but which are:

  • not 2\'s complement or
7条回答
  •  没有蜡笔的小新
    2020-12-01 07:05

    My two cents. Please don't blame hard, this is from my experience, I'm not a theoretic:

    • not 2's complement

    All of the existing CPU's are 2's complement

    • the integer width is not 32 bits or 64 bits

    There are 8 and 16 bits architectures too. 8 bit AVR MCU's is a good example.

    • some integer types have padding bits

    I am not aware of any system, that pads integers. Floating numbers - is a different story.

    • if you worked on a 2's complement machine, the bit pattern with sign bit 1 and all value bits zero is not a valid negative number
    • integer conversion from signed to unsigned (and vice versa) is not via verbatim copying of bit patterns
    • right shift of integer is not arithmetic shift
    • the number of value bits in an unsigned type is not the number of value bits in the corresponding signed type + 1
    • conversion from a wider int type to a smaller type is not by truncation of the left most bits which would not fit

    All of the above - not aware of any, and I assume there is no such machine.

提交回复
热议问题