Skip to content

Instantly share code, notes, and snippets.

@gerdr
Created June 5, 2012 22:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gerdr/2878662 to your computer and use it in GitHub Desktop.
Save gerdr/2878662 to your computer and use it in GitHub Desktop.
m0 C implementation TODO
  • implement both signed and unsigned integer division/remainder ops
  • make callframes variably-sized
  • add hashtable implementation: necessary for CHUNK_MAP/linking stage
  • use unions instead of uint64_t as register type
  • namespacing cleanup (prefix external symbols)
  • add structure for strings
  • make integer size configurable or mandate 64-bit integers
@gerdr
Copy link
Author

gerdr commented Jun 6, 2012

Having two flavors only makes sense for integers, imo, and even that is open to debate:

On the one hand, it adds complexity as we'd need another set of ops. On the other hand, we probably want 64-bit integers on 32-bit architectures, but if this is the only integer type, we'd have to truncate integers every time we want to do pointer arithmetics (and things like loop counters mostly don't need 64-bit precision). However, a good optimizer can help with that (see Javascript, which doesn't have an integer type).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment