bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/29728] bpf: support LLVM BPF pseudo-C assembly syntax


From: cvs-commit at gcc dot gnu.org
Subject: [Bug gas/29728] bpf: support LLVM BPF pseudo-C assembly syntax
Date: Wed, 26 Apr 2023 17:29:56 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=29728

--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot 
gnu.org> ---
The master branch has been updated by Jose E. Marchesi
<jemarch@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ff5a51b377212532a0cf2acea37c6a5672893d8f

commit ff5a51b377212532a0cf2acea37c6a5672893d8f
Author: Guillermo E. Martinez <guillermo.e.martinez@oracle.com>
Date:   Thu Apr 20 16:37:01 2023 +0200

    gas: support for the BPF pseudo-c assembly syntax

    This patch adds support to the GNU assembler for an alternative
    assembly syntax used in BPF.  This syntax is C-like and very
    unconventional for an assembly language, but it is generated by
    clang/llvm and is also used in inline asm templates in kernel code, so
    we ought to support it.

    After this patch, the assembler is able to parse instructions in both
    supported syntax: the normal assembly-like syntax and the pseudo-C
    syntax.  Instruction formats can be mixed in the source program: the
    assembler recognizes the right syntax to use.

    gas/ChangeLog:

    2023-04-20  Guillermo E. Martinez  <guillermo.e.martinez@oracle.com>

            PR gas/29728
            * config/tc-bpf.h (TC_EQUAL_IN_INSN): Define.
            * config/tc-bpf.c (LEX_IS_SYMBOL_COMPONENT): Define.
            (LEX_IS_WHITESPACE): Likewise.
            (LEX_IS_NEWLINE): Likewise.
            (LEX_IS_ARITHM_OP): Likewise.
            (LEX_IS_STAR): Likewise.
            (LEX_IS_CLSE_BR): Likewise.
            (LEX_IS_OPEN_BR): Likewise.
            (LEX_IS_EQUAL): Likewise.
            (LEX_IS_EXCLA): Likewise.
            (ST_EOI): Likewise.
            (MAX_TOKEN_SZ): Likewise.
            (init_pseudoc_lex): New function.
            (md_begin): Call init_pseudoc_lex.
            (valid_expr): New function.
            (build_bpf_non_generic_load): Likewise.
            (build_bpf_atomic_insn): Likewise.
            (build_bpf_jmp_insn): Likewise.
            (build_bpf_arithm_insn): Likewise.
            (build_bpf_endianness): Likewise.
            (build_bpf_load_store_insn): Likewise.
            (look_for_reserved_word): Likewise.
            (is_register): Likewise.
            (is_cast): Likewise.
            (get_token): Likewise.
            (bpf_pseudoc_to_normal_syntax): Likewise.
            (md_assemble): Try pseudo-C syntax if an instruction cannot be
            parsed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]