Project

General

Profile

Actions

Bug #10095

closed

print_imm12 seems to be redundant

Added by Alexander Kamkin about 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
02/04/2020
Due date:
% Done:

100%

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

Description

The print_imm12 operation defined in riscv.nml seems to be redundant:

// Prints the sign-extended 12-bit immediate
pseudo op print_imm12(imm: card(12))
  syntax = format("%d", cast(int(12), imm))

All operations that use print_imm12 (e.g., addi) can be refactored in the following way:

op addi(rd: X, rs1: X, imm: card(12))
  syntax = format("addi %s, %s, %s", rd.syntax, rs1.syntax, print_imm12(imm).syntax)
  ...

=>

op addi(rd: X, rs1: X, imm: int(12))
  syntax = format("addi %s, %s, %d", rd.syntax, rs1.syntax, imm)
  ...
Actions #1

Updated by Alexander Protsenko about 4 years ago

  • Status changed from New to Open
Actions #2

Updated by Alexander Protsenko about 4 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Bug fixed bc5a145e

New bug found: #10096

Actions

Also available in: Atom PDF