Project

General

Profile

Actions

Bug #11654

open

Или правило для регистров может вызывать ошибку "error: incompatible types"

Added by Alexander Protsenko over 2 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Category:
nML Translator
Target version:
-
Start date:
06/14/2022
Due date:
% Done:

0%

Estimated time:
Detected in build:
git
Platform:
Published in build:

Description

Ниже приведен код для модели minimips для воссоздания ошибки:
Регистр:

mode REG (i: INDEX) = GPR[i]
  init   = { tmp = i; }
  // This is just to demonstrate the decode attribute
  decode = { i = tmp; }
  syntax = format("$%d", tmp)
  image  = format("%s", tmp)

mode REG_SHIFT (i: INDEX, shift: BIT) = GPR[i]
  init   = { tmp = i; }
  // This is just to demonstrate the decode attribute
  decode = { i = tmp; }
  syntax = format("%s", if shift == 0
                        then "shift0" 
                        else "shift1" endif)
  image  = format("%s", tmp)

mode REGA = REG_SHIFT | REG

Инструкция:

internal op op_rega_rega_rega(rd: REGA, rs: REGA, rt: REGA)
  image = format("%s%s%s", rs.image, rt.image, rd.image)

op addB (rd: REG, rs: REGA, rt: REGA)
  syntax = format("add %s, %s, %s", rd.syntax, rs.syntax, rt.syntax)
  image = format("000000%s00000100000", op_rega_rega_rega(rd, rs, rt).image)
  action = {
    temp = rs<31>::rs + rt<31>::rt;
    if temp<32> != temp<31> then
      mark("overflow");
      COP0_R[14] = CIA;
      exception("IntegerOverflow");
    else
      mark("normal");
      rd = temp<31..0>;
    endif;
  }

Ошибка:

D:\WorkProjects\MicroTESK\microtesk\build\generated-src\models\src\java\ru\ispras\microtesk\model\minimips\decoder\DecoderAddB.java:75: error: incompatible types: IsaPrimitive cannot be converted to REG
    rd = op_rega_rega_rega_instance.rd;

Actions

Also available in: Atom PDF