Actions
Feature #88
openAdd add_ptr instruction for the pointer arithmetic
Feature #88:
Add add_ptr instruction for the pointer arithmetic
Status:
New
Priority:
Normal
Assignee:
-
Category:
IR
Start date:
Due date:
% Done:
0%
Estimated time:
Description
Adding a number to a pointer always advances the pointer by one byte. This is wrong since the pointer should be advanced by the number multiplied by the size of the pointer base type.
To support this a new TAC instruction should be introduced, "add_ptr": add_ptr(pointer, index, scale, destination).
Updated by Eugen Wissner about 14 hours ago
- I add a new temporary operator for the pointer arithmetic,
|(since the token is known but isn't used yet for anything else). The support for this operator is ported to the stage 19. After that I replace all usages of addition forpointer + numberwith the pipe operator in stage 20. - I implement addition of the right size to a pointer in stage 20, but it won't be used in stage 20 (since stage 19 cannot understand it).
- New stage 21 can use plus operator for the pointer and number addition and can free the
|token again.
Actions