Project

General

Profile

Bug #9398

Некорректная спецификация с использованием версии ревизий

Added by Alexander Protsenko 18 days ago. Updated 18 days ago.

Status:
Resolved
Priority:
Normal
Start date:
11/26/2018
Due date:
% Done:

0%

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

Description

Очень плохой вариант:

op slli(rd: X, rs1: X, imm: card(SHLEN))
  syntax = format("slli %s, %s, 0x%x", rd.syntax, rs1.syntax, imm)
  image  = format("000000%1s%5s%s001%s0010011",
                  if SHLEN == 6 then imm<5> else coerce(BIT, 0) endif,
                  if SHLEN == 5 then imm else imm<4..0> endif,
                  rs1.image,
                  rd.image
                  )
  action = {
    rd = rs1 << imm;
  }

Бит imm<5> для 32х битной версии не существует, а в коде есть.

History

#1 Updated by Alexander Protsenko 18 days ago

  • Status changed from New to Open

#2 Updated by Alexander Protsenko 18 days ago

Правильная версия:

op slli(rd: X, rs1: X, imm: card(SHLEN))
  syntax = format("slli %s, %s, 0x%x", rd.syntax, rs1.syntax, imm)
  @rev(RV64I)
    image  = format("000000%1s%5s%s001%s0010011", imm<5>, imm<4..0>, rs1.image, rd.image)
#ifndef RV64I
  @rev(RV32I)
    image = format("000000%1s%5s%s001%s0010011", coerce(BIT, 0), imm<4..0>, rs1.image, rd.image)
#endif
  action = {
    rd = rs1 << imm;
  }

#3 Updated by Alexander Protsenko 18 days ago

  • Status changed from Open to Resolved

Also available in: Atom PDF