Skip to content

BMASKI, BGENI decodes incorrectly #5

Description

@fxsheep
  1. In the special opcode case (bmaski: 001011000000rrrr, bgeni: 001100100111rrrr), the immediate field is missing in disassembly.
    e.g.
test.o:     file format elf32-mcore-little


Disassembly of section .text:

00000000 <.text>:
   0:	3272      	bgeni	r2, 7
   2:	2c02      	bmaski	r2, 0

Image

(An IMM5 value of 32 is encoded in the instruction as an IMM5 field of 00000 by the assembler. Here objdump decodes bmaski r2, 32 to bmaski r2, 0, which seems to be a bug of binutils as well...)

  1. In the other opcode case, IMM5 field seems to be missing some bits.
    e.g.:
test.o:     file format elf32-mcore-little


Disassembly of section .text:

00000000 <.text>:
   0:	3282      	bgeni	r2, 8
   2:	3292      	bgeni	r2, 9
   4:	32f2      	bgeni	r2, 15
   6:	3302      	bgeni	r2, 16
   8:	33f2      	bgeni	r2, 31
   a:	2c82      	bmaski	r2, 8
   c:	2c92      	bmaski	r2, 9
   e:	2cf2      	bmaski	r2, 15
  10:	2d02      	bmaski	r2, 16
  12:	2df2      	bmaski	r2, 31

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions