Project

General

Profile

Bug #10095

print_imm12 seems to be redundant

Added by Alexander Kamkin 18 days ago. Updated 18 days 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)
  ...

Associated revisions

Revision bc5a145e (diff)
Added by Alexander Protsenko 18 days ago

Bug #10095 fixed

Signed-off-by: Protsenko <>

History

#1

Updated by Alexander Protsenko 18 days ago

  • Status changed from New to Open
#2

Updated by Alexander Protsenko 18 days ago

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

Bug fixed bc5a145e

New bug found: #10096

Also available in: Atom PDF