about summary refs log tree commit diff stats
path: root/023float.cc
Commit message (Collapse)AuthorAgeFilesLines
* 6957Kartik Agaram2020-10-051-2/+30
| | | | | | | | 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.
* 6913 - copying floats aroundKartik Agaram2020-09-301-0/+75
|
* 6911 - comparing floatsKartik Agaram2020-09-301-0/+39
| | | | | | | It turns out floating-point operations set different flags than most instructions. We have to branch on them using unsigned jumps. https://stackoverflow.com/questions/7057501/x86-assembler-floating-point-compare/7057771#7057771
* 6910 - emulate most floating-point operationsKartik Agaram2020-09-301-2/+300
|
* 6886 - floating-point divisionKartik Agaram2020-09-271-0/+48
|
* 6885 - starting on floating-point instructionsKartik Agaram2020-09-271-0/+31
I spent some time deciding on the instructions. x87 is a stack ISA, so not a good fit for the rest of SubX. So we use SSE instead. They operate on 32-bit floats, which seems like a good fit. SSE has a bunch of instructions for operating on up to 4 floats at once. We'll ignore all that and just focus on so-called scalar instructions.