| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rendering is still ugly. Cursor isn't on the right row. But the hard part
is behind us.
This was a stupid mistake in function-body, and it happened because I've
been getting lazy and passing (addr handle) objects when I should be passing
in "constant" addr objects.
I'm not sure why I was so resistant to debugging by print here. I spent
3 days waffling about with this bug.
|
|
|
|
| |
Tile: simplify the contract for render-column.
|
|
|
|
| |
Changing tack..
|
|
|
|
|
| |
Use the fake-screen infrastructure we already have for non-interactive
mode.
|
|
|
|
|
|
| |
We don't have tests yet in the tile prototype, mostly because we don't
yet feel confident about what desired behavior should be. But it's still
helpful to have a non-interactive mode for tracking down segfaults.
|
|
|
|
|
| |
Snapshot. We've gotten arrow keys navigating, but segfault when getting
to the second word in an expanded function call body.
|
| |
|
| |
|
| |
|
|
|
|
| |
Rather surprisingly, this transformation worked the first time!
|
|
|
|
| |
Fix and cleanup.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Snapshot that requires a check in the Mu compiler.
Currently I don't spill a register if it could possibly be over-written
by a function output within. However, find-in-call-path is a good example
of where this constraint is too lenient and results in unsafe code. The
variable `curr` gets clobbered during loop update by the variable `match?`.
What's the answer? Perhaps we should ban all conditional updates to function
outputs? That'd be dashed inconvenient.
|
|
|
|
|
| |
Function expand/contract still works, but the implementation is totally
different under the hood.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Slowly hoist cursor-word from environment to sandbox. This isn't its final
destination.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
The final fix to the raytracing program involves rounding modes. It turns
out x86 processors round floats by default, unlike C which has trained
me to expect truncation. Rather than mess with the MXCSR register, I added
another instruction for truncation. Now milestone 3 emits perfectly correct
results.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The image is now visually indistinguishable from the baseline, though the
file isn't quite bit-for-bit correct.
I found 3 bugs:
a) I forgot to normalize the ray. After creating a helper to "automatically"
do it for me, it turns out said helper requires manually using.
b) I forgot to multiply by t at one place.
c) vec3-length was half-written.
For the umpteenth time, the bugs were all in the last place I looked. I
was worried about spending a lot of time transcribing `main` without any
feedback, but that turned out to be perfect.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Not yet right, but worth a snapshot just because it gives a cool result.
Here, try it out:
$ ./translate_mu_debug apps/raytracing/3.mu
$ ./a.elf > x.ppm
Now view x.ppm as an image.
In general, this was quite tedious to write. And a still-open question
is how to emit the progress bar to stderr. My options are to either duplicate
all my print-* functions (already proliferating) or add global variables
to Mu.
|
|
|
|
| |
Looks good.
|
| |
|
|
|
|
|
|
|
|
| |
Move some implementation around for floating-point.
I originally thought I wouldn't bother supporting sigils like %xmm0. But
it turns out I need them to pass floats into SubX function calls. And it
turns out the sigils work fine for free.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
For most of Mu's history we've selected between primitives based on types
just by checking whether a type is a literal or not. Now we've started
checking if it's a float as well. However, floats need one additional check:
the call site may have an (addr float) that is dereferenced.
|
| |
|
| |
|
|
|
|
| |
https://raytracing.github.io/books/RayTracingInOneWeekend.html
|
| |
|
| |
|
|
|
|
| |
Fix CI.
|
|
|
|
|
|
| |
The realization of commit 6916 means that we should be using jump-if-addr*
after comparing floats. Which is super ugly. Let's create aliases to them
called jump-if-float*.
|
|
|
|
|
| |
We don't yet support emulating these instructions in `bootstrap`. But generated
binaries containing them run natively just fine.
|
|
|
|
| |
Some bugfixes to the previous commit.
|
| |
|
|
|
|
| |
(Though the generated code doesn't work yet.)
|
|
|
|
|
| |
New fields for primitives to support code-generation for floating-point
primitives.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make a few tests more self-contained.
I'd prefer to just run a function called `setup` first thing on startup
and move this portion of convert-mu to it:
# initialize global data structures
c7 0/subop/copy *Next-block-index 1/imm32
8b/-> *Primitive-type-ids 0/r32/eax
89/<- *Type-id 0/r32/eax # stream-write
c7 0/subop/copy *_Program-functions 0/imm32
c7 0/subop/copy *_Program-functions->payload 0/imm32
c7 0/subop/copy *_Program-types 0/imm32
c7 0/subop/copy *_Program-types->payload 0/imm32
c7 0/subop/copy *_Program-signatures 0/imm32
c7 0/subop/copy *_Program-signatures->payload 0/imm32
However, this approach doesn't fix my run_one_test tooling.
|