| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
At the lowest level, SubX without syntax sugar uses names without prepositions.
For example, 01 and 03 are both called 'add', irrespective of source and
destination operand. Horizontal space is at a premium, and we rely on the
comments at the end of each line to fully describe what is happening.
Above that, however, we standardize on a slightly different naming convention
across:
a) SubX with syntax sugar,
b) Mu, and
c) the SubX code that the Mu compiler emits.
Conventions, in brief:
- by default, the source is on the left and destination on the right.
e.g. add %eax, 1/r32/ecx ("add eax to ecx")
- prepositions reverse the direction.
e.g. add-to %eax, 1/r32/ecx ("add ecx to eax")
subtract-from %eax, 1/r32/ecx ("subtract ecx from eax")
- by default, comparisons are left to right while 'compare<-' reverses.
Before, I was sometimes swapping args to make the operation more obvious,
but that would complicate the code-generation of the Mu compiler, and it's
nice to be able to read the output of the compiler just like hand-written
code.
One place where SubX differs from Mu: copy opcodes are called '<-' and
'->'. Hopefully that fits with the spirit of Mu rather than the letter
of the 'copy' and 'copy-to' instructions.
|
|
|
|
| |
One more error condition when desugaring function calls in SubX.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Signed and unsigned don't quite capture the essence of what the different
combinations of x86 flags are doing for SubX. The crucial distinction is
that one set of comparison operators is for integers and the second is
for addresses.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When I created it I was conflating two things:
a) needing to refer to just the start, rather than the whole, and
b) counting indirections.
Both are kinda ill-posed. Now Mu will have just `addr` and `handle` types.
Normal types will translate implicitly to `addr` types, while `handle`
will always require explicit handling.
|
| |
|
| |
|
|
|
|
|
| |
Let's start putting r32 first in compare instructions that need it. Ordering
there is quite subtle and of great import.
|
|
|
|
|
| |
Try to make the comments consistent with the type system we'll eventually
have.
|
|
|
|
|
|
| |
Standardize conventions for labels within objects in the data segment.
We're going to use this in a new tool.
|
|
|
|
|
|
|
| |
Clean up pseudocode to match planned syntax for the type- and memory-safe
level-2 Mu language.
http://akkartik.name/post/mu-2019-2 is already out of date.
|
|
|
|
| |
Replace calculations of constants with labels.
|
| |
|
|
|
|
| |
Thanks Andrew Owen for reporting this typo.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This undoes 5672 in favor of a new plan:
Layers 000 - 099 are for running without syntax sugar. We use them for
building syntax-sugar passes.
Layers 100 and up are for running with all syntax sugar.
The layers are arranged in approximate order so more phases rely on earlier
layers than later ones.
I plan to not use intermediate syntax sugar (just sigils without calls,
or sigils and calls without braces) anywhere except in the specific passes
implementing them.
|
| |
|
| |
|
| |
|
|
|
|
| |
Now added to CI.
|
| |
|
| |
|
| |
|
|
|
|
| |
Fix a bug in call.subx's tokenizer.
|
|
|
|
| |
Done with calls.subx's variant of next-word.
|
|
|
|
|
|
| |
Further flesh out next-word variant for calls.subx. All the code is
sketched out, and baseline tests pass. No tests yet for new
functionality compared to sigils.subx.
|
|
|
|
|
| |
Translating common bits from sigils.subx expression-aware variant of
next-word to use sigils in calls.subx.
|
| |
|
| |
|
|
|