summaryrefslogtreecommitdiff
path: root/src/lem_interp/interp_lib.lem
AgeCommit message (Collapse)Author
2014-04-03Implement some arithmetic operationsGabriel Kerneis
2014-04-03Implement bitwise library operationsGabriel Kerneis
2014-04-03Typeclass Eq for valuesGabriel Kerneis
Again, this is necessary to compare big_int
2014-04-02Solve more constraints; fix up test suite bugs uncovered by solving more ↵Kathy Gray
constraints. Clean up Lem output a little for readability while debugging.
2014-04-02eq and neq return bit, not boolGabriel Kerneis
2014-04-02Fix EXTS and signedness of to_numGabriel Kerneis
2014-04-01Allow negative "nat" internallyGabriel Kerneis
to_num and to_vec probably still need to be fixed
2014-03-20Remove work-around from interpreter, move it to power.sailGabriel Kerneis
Two bugs are worked-around here: - missing cast to nat when a vector is wrapped in exts (exts is a no-op currently anyway, so we are discarding it) - missing cast (due to limited type-inference) in one if branch: type given explicitly.
2014-03-20Workaround missing casts for external callsGabriel Kerneis
This patch should be reverted when the interpreter is fixed. The first instruction of main.bin is now executed. The second one fails, seemingly because of a similar missing cast issue (external function add receives register GPR1 as value).
2014-03-11More work on interpreter and Power modelGabriel Kerneis
2014-03-11Confusion between first index and vector lengthGabriel Kerneis
2014-03-04More polymorphism for additionGabriel Kerneis
2014-02-28Fix endiannessGabriel Kerneis
In fact, increasing order is big-endian, not little-endian. This is good news for us, because it means we do not need any switch for the POWER spec.
2014-02-28Fetch-decode POWER interpreterGabriel Kerneis
Many limitations and bugs currently, but loads binary and decodes opcodes correctly (using endianness hacks). Disabled in the default test suite (but still compiled), run "make test_power" to try it.
2014-02-27Partial fix for to_vec_inc/to_vec_decGabriel Kerneis
Lem's word library does some dark magic because of its assumption that words represent signed integers. Therefore, it is unreliable to truncate words, as well as to use the internal representation. boolListFrombitSeq seems safe for our purposes, though (provided the bitseq has been created with an infinite length from a positive integer).
2014-02-21Add type annotations to lem grammar, including printing out the annotated ↵Kathy Gray
ast, and extending the interpreter to expect annotations. Annotations and locations are still not used by the interpreter.
2014-02-18Remove spurious add infixGabriel Kerneis
2014-02-12More library functions for interpreterGabriel Kerneis
There is now enough stuff to decode and execute a very basic Branch instruction (encoding everything as little-endian rather than big- endian among many other work-arounds).
2014-02-07Fix a few stupid bugsGabriel Kerneis
2014-02-07Implement is_oneGabriel Kerneis
2014-02-05Replace symbolic link by actual fileGabriel Kerneis
2014-02-05First bit of Power specGabriel Kerneis
Only chapter about branches (except system calls because of sail typechecking issue). Decoding seems to work. Execution typechecks currently, but is pretty surely broken otherwise.
2013-11-12Define and test addition in libraryGabriel Kerneis
Notice the need for double parentheses in test/test3.sail, because the interpreter does not perform curryfication automatically (only the first parameter in kept with List_extra.head): add ((1, 3)) (* works *) add (1, 3) (* fails, equivalent to: add (1) *) Fortunately enough, infix functions work correctly by default. A dirty quickfix would be easy, but I'm not sure at which level this should be addressed properly (interpreter? typing? etc.).
2013-11-11Remove workaround for a bug fixed in LemGabriel Kerneis
2013-11-07Port L2 to new LemGabriel Kerneis
Tests compile and run properly. There is a lot of hackery going on to workaround the rough edges of new Lem. Use at your own risk (you need the "library-format" branch of lem).
2013-11-07Stub for external callsGabriel Kerneis