plum-umd / the-838e-compiler

Compiler for CMSC 838E
2 stars 0 forks source link

Updating Read to Parse Flonums and Fixing Flonum Compilation #67

Closed WChung43 closed 3 years ago

WChung43 commented 3 years ago

Hello. This is my small update to my implementation of the Floating point numbers for #1. I have updated read by doing a minor edit and uncommenting, so that the read file can parse Flonums, and I have fixed the compiler and a86 to remove bugs for boxing the result of float arithmetic operations during compilation.

The summary of the changes I made are:

read.rkt

compile.rkt

float.rkt

Possible things to add next:

8tx7K38ej1aBTKWK commented 3 years ago

By the way, I discovered a bug in fl+ and fl- when testing the SDL integration.

The movapd instruction (>=128-bit copy) should be replaced by movsd (64-bit copy). A fix can be found here:

https://github.com/plum-umd/the-838e-compiler/commit/2dd764b535c650a39ae7fe069436c518f41471a5#diff-b6c8fa84f32f5d7e9930a605d234098840001abc94ed39344ae0bc0b4a5f2927R734-R752

WChung43 commented 3 years ago

By the way, I discovered a bug in fl+ and fl- when testing the SDL integration.

The movapd instruction (>=128-bit copy) should be replaced by movsd (64-bit copy). A fix can be found here:

2dd764b#diff-b6c8fa84f32f5d7e9930a605d234098840001abc94ed39344ae0bc0b4a5f2927R734-R752

Don't worry. I saw that bug when testing the read function and I fixed it as part of this pull request in the edits for compile.rkt.