This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: rv64: bug in encoding of bge?
- From: Paulo Matos <pmatos@linki.tools>
- To: binutils at sourceware dot org
- Date: Thu, 10 Jan 2019 09:09:36 +0100
- Subject: Re: rv64: bug in encoding of bge?
- References: <8128e414-7436-2358-6d61-cc0855fbce73@linki.tools> <eeecbac1-9e3d-ecfd-3bc7-3a4752a77d13@sifive.com> <11df1adf-ceae-cc23-4c24-917a1a871846@linki.tools>
On 10/01/2019 08:02, Paulo Matos wrote:
> Of course, I was totally confused because the dump shows
> bge a2,a1,0
> and my eyes were glossing over the <foo> at the end of each line.
> Therefore I expected that all instructions should be looping to themselves.
>
> But the original code has them all looping back to foo.
>
> Got it, thanks.
In order to confirm my suspicion, the bge (and other branches) take an
address as the third argument, the assemble then subtracts the PC from
it and puts the result into the offset field of the instruction. Is this
correct?
Kind regards,
--
Paulo Matos