This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [committed] RISC-V: Accept constant operands in la and lla
- From: Palmer Dabbelt <palmer at sifive dot com>
- To: sebastian dot huber at embedded-brains dot de
- Cc: binutils at sourceware dot org
- Date: Thu, 21 Jun 2018 09:06:47 -0700 (PDT)
- Subject: Re: [committed] RISC-V: Accept constant operands in la and lla
On Wed, 20 Jun 2018 21:17:55 PDT (-0700), sebastian.huber@embedded-brains.de wrote:
On 21/06/18 00:53, Palmer Dabbelt wrote:
On Tue, 19 Jun 2018 22:27:25 PDT (-0700),
sebastian.huber@embedded-brains.de wrote:
opcodes/
PR gas/23305
* riscv-opc.c (riscv_opcodes): Use new format specifier 'B' for
la and lla.
gas/
PR gas/23305
* config/tc-riscv.c (riscv_ip): Add format specifier 'B' for
constants and symbols.
* testsuite/gas/riscv/lla32.d: New file.
* testsuite/gas/riscv/lla32.s: Likewise.
* testsuite/gas/riscv/lla64-fail.d: Likewise.
* testsuite/gas/riscv/lla64-fail.l: Likewise.
* testsuite/gas/riscv/lla64-fail.s: Likewise.
* testsuite/gas/riscv/lla64.d: Likewise.
* testsuite/gas/riscv/lla64.s: Likewise.
---
gas/ChangeLog | 13 +++++++++++++
gas/config/tc-riscv.c | 11 +++++++++++
gas/testsuite/gas/riscv/lla32.d | 19 +++++++++++++++++++
gas/testsuite/gas/riscv/lla32.s | 15 +++++++++++++++
gas/testsuite/gas/riscv/lla64-fail.d | 3 +++
gas/testsuite/gas/riscv/lla64-fail.l | 2 ++
gas/testsuite/gas/riscv/lla64-fail.s | 3 +++
gas/testsuite/gas/riscv/lla64.d | 20 ++++++++++++++++++++
gas/testsuite/gas/riscv/lla64.s | 17 +++++++++++++++++
opcodes/ChangeLog | 6 ++++++
opcodes/riscv-opc.c | 4 ++--
11 files changed, 111 insertions(+), 2 deletions(-)
create mode 100644 gas/testsuite/gas/riscv/lla32.d
create mode 100644 gas/testsuite/gas/riscv/lla32.s
create mode 100644 gas/testsuite/gas/riscv/lla64-fail.d
create mode 100644 gas/testsuite/gas/riscv/lla64-fail.l
create mode 100644 gas/testsuite/gas/riscv/lla64-fail.s
create mode 100644 gas/testsuite/gas/riscv/lla64.d
create mode 100644 gas/testsuite/gas/riscv/lla64.s
I'm not opposed to this, but did you check with a RISC-V maintainer
before committing it? In general we try to keep our assembly syntax
compatible between the various assemblers, so any interface addition
should be discussed to make sure it's feasible everywhere.
Sorry, I should have mentioned that this was pre-approved by Jim Wilson
in the referenced PR:
https://sourceware.org/bugzilla/show_bug.cgi?id=23305
Ah, OK, sorry I missed that.
Which other assemblers are there to consider?
At least LLVM, which is spinning up. There's also a bunch of proprietary tools
companies, which is what I'm more worried about -- I don't want to have to deal
with users complaining about undocumented assembly extensions those toolchains
add so it really wouldn't be fair to have stuff of our own.
I try to add a documentation of "lla". See also:
https://groups.google.com/a/groups.riscv.org/forum/#!topic/sw-dev/sDQWmHyzHi8
Thanks. I suppose this should be documented in the GAS manual, though we don't
have any of the pseudos in there. Do you mind adding a section to
gas/doc/c-riscv.texi
for pseduo ops that contains lla? We can add the rest later...
Additionally, we've been collecting all the standard interfaces in RISC-V
specific manuals. Do you mind adding a bit here about lla (and then modifying
the la bit to include that it can take constants)
https://github.com/riscv/riscv-asm-manual/blob/master/riscv-asm.md
I also left a comment in the middle of the source about "lla 0xFFFFFFFF" on
RV64I, which I think should be supported.
Thanks for the patch, and sorry for making so much more work :)