[llvm-dev] RFC: On non 8-bit bytes and the target for it

David Chisnall via llvm-dev llvm-dev at lists.llvm.org
Thu Oct 31 04:48:28 PDT 2019


On 31/10/2019 11:17, Dmitriy Borisenkov wrote:
> David, just to clarify a misconception I might have introduced, we do 
> not have linear memory in the sense that all data is stored as a trie. 
> We do support arrays, structures and GEPs, however, as well as all 
> relevant features in C by modeling memory.

So, if I understand correctly, your memory is a key-value store where 
the keys are 257-bit values and the values are arrays of 257-bit values? 
  Or they values are 257-bit values?  To help the discussion, please can 
you explain how the following are represented:

  - A pointer to an object.
  - A pointer to a field in an object.
  - An arbitrary void*.
  - The C string "hello world"

> So regarding concepts of byte, all 5 statements you gave are true for 
> our target. Either due to the specification or because of 
> performance (gas consumption) issues. But if there are architectures 
> that need less from the notion of byte, we should try to figure out the 
> common denominator. It's probably ok to be less restrictive about a byte.

It seems odd to encode a C string as an array of 257-bit values, rather 
than as an array of 8-bit values that are stored in 32-char chunks.

David


More information about the llvm-dev mailing list