Commit 34a57d1
committed
fix(compiler): GEP byte offset handling and F32 float literals
- Add U8/I8 scalar type handling in Cranelift GEP for byte-level offsets
- Add float_literal() method to TypedASTBuilder (defaults to F32)
- Add translate_literal_with_type() for type-aware literal conversion
- Float literals now correctly use F32 for ML workloads
This fixes tensor array construction which was storing F64 values into
F32 slots, causing the tensor data to be corrupted.1 parent eab71ed commit 34a57d1
4 files changed
Lines changed: 41 additions & 7 deletions
File tree
- crates
- compiler/src
- typed_ast/src
- zyn_peg/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1162 | 1162 | | |
1163 | 1163 | | |
1164 | 1164 | | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
1165 | 1172 | | |
1166 | | - | |
| 1173 | + | |
1167 | 1174 | | |
1168 | 1175 | | |
1169 | 1176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1330 | 1330 | | |
1331 | 1331 | | |
1332 | 1332 | | |
1333 | | - | |
1334 | 1333 | | |
| 1334 | + | |
1335 | 1335 | | |
1336 | 1336 | | |
1337 | 1337 | | |
| |||
3168 | 3168 | | |
3169 | 3169 | | |
3170 | 3170 | | |
3171 | | - | |
| 3171 | + | |
3172 | 3172 | | |
| 3173 | + | |
| 3174 | + | |
| 3175 | + | |
| 3176 | + | |
| 3177 | + | |
3173 | 3178 | | |
3174 | 3179 | | |
3175 | 3180 | | |
3176 | 3181 | | |
3177 | 3182 | | |
3178 | 3183 | | |
3179 | 3184 | | |
3180 | | - | |
| 3185 | + | |
| 3186 | + | |
| 3187 | + | |
| 3188 | + | |
| 3189 | + | |
| 3190 | + | |
| 3191 | + | |
3181 | 3192 | | |
3182 | 3193 | | |
3183 | 3194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
106 | 124 | | |
107 | 125 | | |
108 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1482 | 1482 | | |
1483 | 1483 | | |
1484 | 1484 | | |
1485 | | - | |
1486 | | - | |
1487 | | - | |
| 1485 | + | |
1488 | 1486 | | |
1489 | 1487 | | |
1490 | 1488 | | |
| |||
0 commit comments