Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
03d6936
AST-33: codegen for Word8/16
ggreif Mar 5, 2019
9f9a4dd
generate special code for Word8/16 infectious operations
ggreif Mar 5, 2019
3a12d86
fix embarrassing thinko about Xor
ggreif Mar 6, 2019
f3287ec
oooops, cannot share, type dependent
ggreif Mar 6, 2019
16d81ef
refactoring
ggreif Mar 6, 2019
fb5ae0c
add Word32 test actor
ggreif Mar 6, 2019
489e6f1
Merge remote-tracking branch 'origin/master' into gabor/conversions
ggreif Mar 6, 2019
00777ed
use share_code1 and provide dummy PowOp
ggreif Mar 6, 2019
cae5449
very naive pow for Word32
ggreif Mar 6, 2019
4d7bb4a
silly me
ggreif Mar 6, 2019
c8e3074
fix tests (hint: they look a bit strange)
ggreif Mar 6, 2019
00f5ab2
pow16
ggreif Mar 6, 2019
895ad21
add GC and serialisation support for SmallWord
ggreif Mar 6, 2019
2a2c1e3
third one's the charm: Word8
ggreif Mar 7, 2019
11f9646
finish up demo
ggreif Mar 7, 2019
0bb9d8e
implement codegen for Word8/16 Rotl/Rotr
ggreif Mar 7, 2019
da9f84e
Merge branch 'master' into gabor/conversions
ggreif Mar 7, 2019
ea6caf7
also test Word16 in actors
ggreif Mar 7, 2019
395b402
clamp_shift_amount
ggreif Mar 7, 2019
72b83be
Merge branch 'master' into gabor/conversions
ggreif Mar 8, 2019
94e73d0
bug fixed
ggreif Mar 8, 2019
4271874
refactor
ggreif Mar 8, 2019
31459b1
a bit more of refactoring
ggreif Mar 8, 2019
40c4e87
bit-fiddling doesn't need an environment
ggreif Mar 8, 2019
09ce369
lognot is unary (^)
ggreif Mar 8, 2019
de66184
add Char<->Word32 interpreter conversions
ggreif Mar 8, 2019
97e3682
complation of Char
ggreif Mar 8, 2019
d4e02a0
these pass now
ggreif Mar 8, 2019
b761cb6
Chars are comparable now
ggreif Mar 8, 2019
385715e
inline printW16/32 definitions
ggreif Mar 9, 2019
f73e393
adapt output
ggreif Mar 9, 2019
2cb8ce1
spice up with FileCheck tests
ggreif Mar 9, 2019
fa676b5
add exotic bitwise operations
ggreif Mar 9, 2019
7db75e3
accept success!
ggreif Mar 9, 2019
e7ac92a
implement 'shrs' for Word32
ggreif Mar 9, 2019
292daac
tighten checks
ggreif Mar 9, 2019
22a9ea5
Merge branch 'master' into gabor/conversions
ggreif Mar 9, 2019
98ea8b5
use the 2n+k algorithm for pow
ggreif Mar 9, 2019
9e6b9a1
try go green
ggreif Mar 9, 2019
6cef59a
undo bad change
ggreif Mar 10, 2019
57bc97e
refacor pow generator
ggreif Mar 10, 2019
4781ab6
sanitise left shift
ggreif Mar 10, 2019
269c571
minor tweak
ggreif Mar 10, 2019
40732d6
simplify
ggreif Mar 10, 2019
6d70731
another attempt to go green
ggreif Mar 10, 2019
a82204b
ok files
ggreif Mar 10, 2019
32c105c
no idea where this comes from
ggreif Mar 10, 2019
e6a48b1
262858d Revert "ok files"
ggreif Mar 10, 2019
25cdb78
move helper functions
ggreif Mar 10, 2019
322db4c
review feedback
ggreif Mar 11, 2019
aa8c8da
use load_field/store_field
ggreif Mar 11, 2019
4dcc7ec
use Tagged.obj
ggreif Mar 11, 2019
3d3cbb9
Merge branch 'master' into gabor/conversions
ggreif Mar 11, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
200 changes: 122 additions & 78 deletions src/compile.ml

Large diffs are not rendered by default.

76 changes: 0 additions & 76 deletions test/run/ok/bit-ops.wasm.stderr.ok
Original file line number Diff line number Diff line change
@@ -1,82 +1,6 @@
compile_unop: NotOp
compile_unop: NotOp
compile_binop: OrOp
of_type: Word8
compile_binop: OrOp
of_type: Word8
compile_binop: AndOp
of_type: Word8
compile_binop: AndOp
of_type: Word8
compile_binop: XorOp
of_type: Word8
compile_binop: XorOp
of_type: Word8
compile_binop: ShiftLOp
of_type: Word8
compile_binop: ShiftLOp
of_type: Word8
compile_binop: ShiftROp
of_type: Word8
compile_binop: ShiftROp
of_type: Word8
compile_binop: RotLOp
of_type: Word8
compile_binop: RotLOp
of_type: Word8
compile_binop: RotROp
of_type: Word8
compile_binop: RotROp
of_type: Word8
compile_unop: NotOp
compile_unop: NotOp
compile_binop: OrOp
of_type: Word16
compile_binop: OrOp
of_type: Word16
compile_binop: AndOp
of_type: Word16
compile_binop: AndOp
of_type: Word16
compile_binop: XorOp
of_type: Word16
compile_binop: XorOp
of_type: Word16
compile_binop: ShiftLOp
of_type: Word16
compile_binop: ShiftLOp
of_type: Word16
compile_binop: ShiftROp
of_type: Word16
compile_binop: ShiftROp
of_type: Word16
compile_binop: RotLOp
of_type: Word16
compile_binop: RotLOp
of_type: Word16
compile_binop: RotROp
of_type: Word16
compile_binop: RotROp
of_type: Word16
compile_unop: NotOp
compile_unop: NotOp
compile_binop: OrOp
compile_binop: OrOp
compile_binop: AndOp
compile_binop: AndOp
compile_binop: XorOp
compile_binop: XorOp
compile_binop: ShiftLOp
compile_binop: ShiftLOp
compile_binop: ShiftROp
compile_binop: ShiftROp
compile_binop: RotLOp
compile_binop: RotLOp
compile_binop: RotROp
compile_binop: RotROp
compile_unop: NotOp
compile_unop: NotOp
compile_binop: OrOp
of_type: Word64
compile_binop: OrOp
of_type: Word64
Expand Down
2 changes: 0 additions & 2 deletions test/run/ok/literals.wasm.stderr.ok
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
compile_lit: (Word8Lit 255)
compile_lit: (Word16Lit 6_5535)
compile_lit: (CharLit 2612)
54 changes: 0 additions & 54 deletions test/run/ok/numeric-ops.wasm.stderr.ok
Original file line number Diff line number Diff line change
Expand Up @@ -30,64 +30,10 @@ compile_binop: PowOp
of_type: Float
compile_binop: PowOp
of_type: Float
compile_binop: AddOp
of_type: Word8
compile_binop: AddOp
of_type: Word8
compile_binop: SubOp
of_type: Word8
compile_binop: SubOp
of_type: Word8
compile_binop: MulOp
of_type: Word8
compile_binop: MulOp
of_type: Word8
compile_binop: DivOp
of_type: Word8
compile_binop: DivOp
of_type: Word8
compile_binop: ModOp
of_type: Word8
compile_binop: ModOp
of_type: Word8
compile_binop: PowOp
of_type: Word8
compile_binop: PowOp
of_type: Word8
compile_binop: AddOp
of_type: Word16
compile_binop: AddOp
of_type: Word16
compile_binop: SubOp
of_type: Word16
compile_binop: SubOp
of_type: Word16
compile_binop: MulOp
of_type: Word16
compile_binop: MulOp
of_type: Word16
compile_binop: DivOp
of_type: Word16
compile_binop: DivOp
of_type: Word16
compile_binop: ModOp
of_type: Word16
compile_binop: ModOp
of_type: Word16
compile_binop: PowOp
of_type: Word16
compile_binop: PowOp
of_type: Word16
compile_binop: AddOp
compile_binop: AddOp
compile_binop: SubOp
compile_binop: SubOp
compile_binop: MulOp
compile_binop: MulOp
compile_binop: DivOp
compile_binop: DivOp
compile_binop: ModOp
compile_binop: ModOp
compile_binop: PowOp
compile_binop: PowOp
compile_binop: AddOp
Expand Down
56 changes: 0 additions & 56 deletions test/run/ok/relational-ops.wasm.stderr.ok
Original file line number Diff line number Diff line change
Expand Up @@ -23,62 +23,6 @@ of_type: Float
compile_relop: GeOp
of_type: Float
compile_eq: EqOp
of_type: Word8
compile_eq: EqOp
of_type: Word8
compile_eq: EqOp
of_type: Word8
compile_eq: EqOp
of_type: Word8
compile_relop: LtOp
of_type: Word8
compile_relop: LtOp
of_type: Word8
compile_relop: LeOp
of_type: Word8
compile_relop: LeOp
of_type: Word8
compile_relop: GtOp
of_type: Word8
compile_relop: GtOp
of_type: Word8
compile_relop: GeOp
of_type: Word8
compile_relop: GeOp
of_type: Word8
compile_eq: EqOp
of_type: Word16
compile_eq: EqOp
of_type: Word16
compile_eq: EqOp
of_type: Word16
compile_eq: EqOp
of_type: Word16
compile_relop: LtOp
of_type: Word16
compile_relop: LtOp
of_type: Word16
compile_relop: LeOp
of_type: Word16
compile_relop: LeOp
of_type: Word16
compile_relop: GtOp
of_type: Word16
compile_relop: GtOp
of_type: Word16
compile_relop: GeOp
of_type: Word16
compile_relop: GeOp
of_type: Word16
compile_relop: LtOp
compile_relop: LtOp
compile_relop: LeOp
compile_relop: LeOp
compile_relop: GtOp
compile_relop: GtOp
compile_relop: GeOp
compile_relop: GeOp
compile_eq: EqOp
of_type: Word64
compile_eq: EqOp
of_type: Word64
Expand Down
3 changes: 3 additions & 0 deletions test/run/ok/words.run-ir.ok
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
8912765 8912765
4286054531 -8912765
4286054530 -8912766
8917332 8917332
8908198 8908198
31969 31969
Expand All @@ -15,6 +16,7 @@
4194373630 -100593666
55734 -9802
9802 9802
9801 9801
60301 -5235
51167 -14369
31969 31969
Expand All @@ -30,6 +32,7 @@
28083 28083
34 34
222 -34
221 -35
101 101
223 -33
213 -43
Expand Down
3 changes: 3 additions & 0 deletions test/run/ok/words.run-low.ok
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
8912765 8912765
4286054531 -8912765
4286054530 -8912766
8917332 8917332
8908198 8908198
31969 31969
Expand All @@ -15,6 +16,7 @@
4194373630 -100593666
55734 -9802
9802 9802
9801 9801
60301 -5235
51167 -14369
31969 31969
Expand All @@ -30,6 +32,7 @@
28083 28083
34 34
222 -34
221 -35
101 101
223 -33
213 -43
Expand Down
3 changes: 3 additions & 0 deletions test/run/ok/words.run.ok
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
8912765 8912765
4286054531 -8912765
4286054530 -8912766
8917332 8917332
8908198 8908198
31969 31969
Expand All @@ -15,6 +16,7 @@
4194373630 -100593666
55734 -9802
9802 9802
9801 9801
60301 -5235
51167 -14369
31969 31969
Expand All @@ -30,6 +32,7 @@
28083 28083
34 34
222 -34
221 -35
101 101
223 -33
213 -43
Expand Down
76 changes: 0 additions & 76 deletions test/run/ok/words.wasm.stderr.ok
Original file line number Diff line number Diff line change
@@ -1,79 +1,3 @@
compile_binop: AddOp
compile_binop: SubOp
compile_binop: MulOp
compile_binop: DivOp
compile_binop: ModOp
compile_binop: PowOp
compile_binop: AndOp
compile_binop: OrOp
compile_binop: XorOp
compile_binop: ShiftLOp
compile_binop: ShiftROp
compile_binop: RotLOp
compile_binop: RotROp
compile_lit: (Word16Lit 4_567)
compile_lit: (Word16Lit 7)
compile_lit: (Word16Lit 5_5734)
compile_lit: (Word16Lit 15)
compile_lit: (Word16Lit 20_000)
compile_binop: AddOp
of_type: Word16
compile_binop: SubOp
of_type: Word16
compile_binop: MulOp
of_type: Word16
compile_binop: DivOp
of_type: Word16
compile_binop: ModOp
of_type: Word16
compile_binop: PowOp
of_type: Word16
compile_lit: (Word16Lit 2)
compile_binop: AndOp
of_type: Word16
compile_binop: OrOp
of_type: Word16
compile_binop: XorOp
of_type: Word16
compile_binop: ShiftLOp
of_type: Word16
compile_binop: ShiftROp
of_type: Word16
compile_binop: RotLOp
of_type: Word16
compile_binop: RotROp
of_type: Word16
compile_lit: (Word8Lit 67)
compile_lit: (Word8Lit 7)
compile_lit: (Word8Lit 34)
compile_unop: NegOp
compile_lit: (Word8Lit 15)
compile_lit: (Word8Lit 200)
compile_unop: NegOp
compile_binop: AddOp
of_type: Word8
compile_binop: SubOp
of_type: Word8
compile_binop: MulOp
of_type: Word8
compile_binop: DivOp
of_type: Word8
compile_binop: ModOp
of_type: Word8
compile_binop: PowOp
of_type: Word8
compile_lit: (Word8Lit 2)
compile_binop: AndOp
of_type: Word8
compile_binop: OrOp
of_type: Word8
compile_binop: XorOp
of_type: Word8
compile_binop: ShiftLOp
of_type: Word8
compile_binop: ShiftROp
of_type: Word8
compile_binop: RotLOp
of_type: Word8
compile_binop: RotROp
of_type: Word8
3 changes: 3 additions & 0 deletions test/run/words.as
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

printW32ln(+c);
printW32ln(-c);
printW32ln(^c);
printW32ln(a + c);
printW32ln(c - a);
printW32ln(a * b);
Expand Down Expand Up @@ -44,6 +45,7 @@

printW16ln(+c);
printW16ln(-c);
printW16ln(^c);
printW16ln(a + c);
printW16ln(c - a);
printW16ln(a * b);
Expand Down Expand Up @@ -77,6 +79,7 @@

printW8ln(+c);
printW8ln(-c);
printW8ln(^c);
printW8ln(a + c);
printW8ln(c - a);
printW8ln(a * b);
Expand Down