Task #5720
closed
Aliases for arrays of registers
Added by Mikhail Chupilko over 9 years ago.
Updated over 9 years ago.
Assignee:
Andrei Tatarnikov
Detected in build:
2.1.5-beta-150305
Published in build:
150522
Description
It would be very convenient and useful to have aliases for arrays of regs. The example follows.
reg GPR [32, DWORD]
reg X [32, DWORD] alias = GPR // expected
reg W [32, WORD] alias = GPR // expected
- Target version changed from 2.1 to 2.2
- Status changed from New to Open
Started - r3619 (grammar rules + sketch of runtime library code).
- % Done changed from 0 to 30
Sketch implementation is done - r3630.
- % Done changed from 30 to 70
- Status changed from Open to Resolved
Examples:
The structure reg Y [N, T] alias = X [MIN..MAX]
allows interpreting a part of the X array from MIN to MAX as an array of type T that includes N items.
Precondition: sizeof(Type of array X)
must be divisible to sizeof(T)
.
reg GPR [32, WORD]
reg GPRS1 [2, SHORT] alias = GPR // Interpret GPR[0] as an array of 2 SHORTs
reg GPRS2 [64, SHORT] alias = GPR[0..31] // Interpret GPR (entire) as an array of 64 SHORTs
reg GPRS3 [32, SHORT] alias = GPR[16..31] // Interpret the second half of GPR as an array of 32 SHORTs
- Status changed from Resolved to Closed
- % Done changed from 70 to 100
- Published in build set to 150522
Also available in: Atom
PDF