From fca0ebbe0cc01d37e47822d8a62ea062a845f33d Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 12 May 2015 18:08:47 -0700 Subject: 1360 - store doubles in memory This is a far cleaner way to provide *some* floating-point support. We can only represent signed integers up to 2^51 rather than 2^63. But in exchange we don't have to worry about it elsewhere, and it's probably faster than checking tag bits in every operation. Hmm, yeah, surprised how easy this was. I think I'll give up on the other approach. I still don't have non-integer literals. But we won't bother with those until we need them. `3.14159:literal` seems ugly. --- 043space.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '043space.cc') diff --git a/043space.cc b/043space.cc index b0ee7f85..2a8ff4fc 100644 --- a/043space.cc +++ b/043space.cc @@ -107,7 +107,7 @@ index_t address(index_t offset, index_t base) { return base+1 + offset; } -:(after "void write_memory(reagent x, vector data)") +:(after "void write_memory(reagent x, vector data)") if (x.name == "default-space") { assert(data.size() == 1); Current_routine->calls.top().default_space = data.at(0); @@ -122,9 +122,9 @@ recipe main [ ] +mem: storing 10 in location 1 -:(after "vector read_memory(reagent x)") +:(after "vector read_memory(reagent x)") if (x.name == "default-space") { - vector result; + vector result; result.push_back(Current_routine->calls.top().default_space); return result; } -- cgit 1.4.1-2-gfad0