Project

General

Profile

Actions

Bug #5717

closed

Usage of regs as operation parameters

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

Status:
Closed
Priority:
Low
Assignee:
Andrei Tatarnikov
Category:
ISA Simulator
Target version:
-
Start date:
03/18/2015
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Detected in build:
2.1.5-beta-150305
Platform:
Published in build:
150324

Description

Usage of

REG(31)
in the following code fragment will result in "incompatible type" error but should not do it.
op subs (rd: REG, rn: REG, imm12: card(12), shift: card(2))
...
op cmp (rn: REG, imm12: card(12))
/** Compare (extended immediate): alias for SUBS XZR,Xn|SP,#aimm.
    CMP Xn|SP, #aimm */
  syntax = format("cmp %s, %d", rn.syntax, imm12)
  image = format("%d111000100%12s%5s11111", 1, imm12, rn.image)
  action = {
    shift_flag = coerce(card(2), 0);
    subs(REG(31), rn, imm12, shift_flag).action;
  }

Result:
    [javac] C:\work\microtesk-2.1.5-beta-150305\gen\src\java\ru\ispras\microtesk\model\armv8\op\cmp.java:85: error: incompatible types: Data cannot be converted to Location
    [javac]         new subs(new REG(DataEngine.valueOf(Type.INT(8), 31)), rn, imm12, shift_flag.access()).action();
    [javac]                                            ^


Subtasks 1 (0 open1 closed)

Task #5721: Usage of register indexes in operation action block callClosedAndrei Tatarnikov03/18/2015

Actions
Actions #1

Updated by Andrei Tatarnikov over 9 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Fixed in r3319.

Actions #2

Updated by Andrei Tatarnikov over 9 years ago

op test_instr(rd : REG, addr : WORD)
  syntax = format("la %s, %<label>d", rd.syntax, addr)
  image  = format("%s%s", lui(rd, addr<16..31>).image,
                          ori(rd, rd, addr<0..15>).image)
  action = {
    instruction(lui(rd, addr<16..31>)).action;
    instruction(ori(rd, rd, addr<0..15>)).action;

    instruction(lui(rd, 0xDEAD)).action;
    instruction(ori(rd, rd, 0xBEEF)).action;

    instruction(lui(rd, addr<16..31> + 1)).action;
    instruction(ori(rd, rd, addr<0..15> + 2)).action;
  }
Actions #3

Updated by Mikhail Chupilko over 9 years ago

  • Status changed from Resolved to Verified
  • Detected in build changed from svn to 2.1.5-beta-150305

OK. I created a new task about the similar problem (#5721)

Actions #4

Updated by Andrei Tatarnikov over 9 years ago

  • Status changed from Verified to Closed
  • Target version deleted (2.1)
  • Published in build set to 150324
Actions

Also available in: Atom PDF