rv64: bug in encoding of bge?

Paulo Matos pmatos@linki.tools
Wed Jan 9 14:11:00 GMT 2019


Hi,

There's a gas bge test which passes but I don't understand why this
should be so.

assembling the test bge.s results in:
$ gas/as-new -march=rv64ima gas/testsuite/gas/riscv/bge.s
$ binutils/objdump -d a.out

a.out:     file format elf64-littleriscv


Disassembly of section .text:

0000000000000000 <foo>:
   0:   00c5d063                bge     a1,a2,0 <foo>
   4:   feb65ee3                bge     a2,a1,0 <foo>
   8:   fec5fce3                bgeu    a1,a2,0 <foo>
   c:   feb67ae3                bgeu    a2,a1,0 <foo>


The first encoding looks fine but the first byte of the others (0xfe)
just don't look correct. For example, for the second instruction I would
have expected:
   4:   00b65063                bge a2,a1,0

The regexp that passes the test checks exactly for this decoding but
it's not obvious to me why it's correct. What am I missing here?

-- 
Paulo Matos



More information about the Binutils mailing list