Project

General

Profile

Actions

Task #5720

closed

Aliases for arrays of registers

Added by Mikhail Chupilko over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Andrei Tatarnikov
Category:
nML Translator
Target version:
Start date:
03/18/2015
Due date:
% Done:

100%

Estimated time:
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

Actions #1

Updated by Alexander Kamkin over 9 years ago

  • Target version changed from 2.1 to 2.2
Actions #2

Updated by Andrei Tatarnikov over 9 years ago

  • Status changed from New to Open

Started - r3619 (grammar rules + sketch of runtime library code).

Actions #3

Updated by Andrei Tatarnikov over 9 years ago

  • % Done changed from 0 to 30

In progress: r3624.

Actions #4

Updated by Andrei Tatarnikov over 9 years ago

r3625.
r3626
r3627
r3628

Actions #5

Updated by Andrei Tatarnikov over 9 years ago

Sketch implementation is done - r3630.

Actions #6

Updated by Andrei Tatarnikov over 9 years ago

  • % Done changed from 30 to 70
Actions #7

Updated by Andrei Tatarnikov over 9 years ago

needs testing

Actions #8

Updated by Andrei Tatarnikov over 9 years ago

  • Status changed from Open to Resolved

Done. r3633.

Actions #9

Updated by Andrei Tatarnikov over 9 years ago

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
Actions #10

Updated by Andrei Tatarnikov over 9 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 70 to 100
  • Published in build set to 150522
Actions

Also available in: Atom PDF