diff options
author | Camil Staps | 2016-10-04 10:43:15 +0200 |
---|---|---|
committer | Camil Staps | 2016-10-04 10:43:15 +0200 |
commit | 1e16a6a7d3e36b0dcd3a0dac8efca09b0c05944e (patch) | |
tree | 134a15e0ca3b786c9dfbe47757807e295ef89fae /log.md | |
parent | Log 10-03 (diff) |
Log: conditional execution, heap full
Diffstat (limited to 'log.md')
-rw-r--r-- | log.md | 49 |
1 files changed, 48 insertions, 1 deletions
@@ -146,7 +146,8 @@ Both? ### 2016-10-03 Another **problem**: the Start rule `twice twice ((+) 1) 0` gives a -segmentation fault. At some point it switches to ARM mode. +segmentation fault. At some point it switches to ARM mode. This is probably +something that should be tackled later on. **Yet another problem**: the Start rule `[]` segfaults. The issue turns out to be that for this rule, the node entry point `n1` is accidentally @@ -154,3 +155,49 @@ halfword-aligned. Hence, its bit 1 is set. This bit is used to store if a node has been reduced to (r)nf yet (not sure if rnf or nf). Therefore, it is not evaluated to `[]` properly before printing it. The **solution** to this issue is to `.align` node entry points (cg: `d9c2a69`). + +**New problem**: conditional instructions don't have a preceding `IT` +instruction. A minimal example (borrowing some functions from StdEnv) is +`Start = 1 < 2`. It seems to be resolved quite easily by adding an `IT` block +(cg `9496e96`). + +**Question**: it is unclear to me how the instructions for `IFSGE` and `IFSLT` +work. They branch, rather than move (`cgarmwas.c`): + +```c +case IFSGE: + w_as_set_float_condition_instruction (instruction,"bpl","bmi"); +``` + +The generated code would then be something like: + +```armasm +bpl rx,#1 +bmi rx,#0 +``` + +but what the constants are for (and if this is valid syntax) is unclear to me. + +**Problem**: there is no `Heap full` message. This can be verified with: + +```clean +fromto :: !Int !Int -> [Int] +fromto a b +| a > b = [] +| otherwise = [a:fromto (a+1) b] + +length :: [a] -> Int +length xs = len 0 xs +where + len :: Int [a] -> Int + len i [] = i + len i [_:xs] = len (i+1) xs + +hd :: [a] -> a +hd [x:_] = x + +Start = let xs = fromto 1 100 in (length xs, hd xs) +``` + +and running with `-h 1k`. The program segfaults rather than displaying a `Heap +full` message. |