FFmpeg
Loading...
Searching...
No Matches
rasm_print.c File Reference
#include <stdarg.h>
#include <string.h>
#include "libavutil/bprint.h"
#include "libavutil/error.h"
#include "libavutil/mem.h"
#include "rasm.h"

Go to the source code of this file.

Macros

#define INSTR_INDENT   8
 Static file backend for the runtime assembler.
 
#define COMMENT_COL   56
 

Functions

static void indent_to (AVBPrint *bp, unsigned line_start, int col)
 
static void print_op_imm (AVBPrint *bp, RasmOp op)
 
static void print_op_label (const RasmContext *rctx, AVBPrint *bp, RasmOp op, const int *local_labels)
 
static void print_op_gpr (AVBPrint *bp, RasmOp op)
 
static char elem_type_char (uint8_t elem_size)
 
static void print_vec_reg (AVBPrint *bp, uint8_t n, uint8_t el_count, uint8_t el_size, uint8_t idx_p1)
 
static void print_op_vec (AVBPrint *bp, RasmOp op)
 
static void print_base_reg (AVBPrint *bp, uint8_t n)
 
static void print_op_base (AVBPrint *bp, RasmOp op)
 
static const char * cond_name (uint8_t cond)
 
static void print_op_cond (AVBPrint *bp, RasmOp op)
 
static void print_op (const RasmContext *rctx, AVBPrint *bp, const int *local_labels, RasmOp op)
 
static const char * insn_name (int id)
 
static void print_node_insn (const RasmContext *rctx, AVBPrint *bp, unsigned line_start, const RasmNode *node, const int *local_labels)
 
static void print_node_comment (const RasmContext *rctx, AVBPrint *bp, unsigned line_start, const RasmNode *node)
 
static void print_node_label (const RasmContext *rctx, AVBPrint *bp, unsigned line_start, const RasmNode *node, int *local_labels)
 
static void print_node_function (const RasmContext *rctx, AVBPrint *bp, unsigned line_start, const RasmNode *node)
 
static void print_node_endfunc (const RasmContext *rctx, AVBPrint *bp, unsigned line_start, const RasmNode *node)
 
static void print_node_directive (const RasmContext *rctx, AVBPrint *bp, unsigned line_start, const RasmNode *node)
 
int rasm_print (RasmContext *rctx, AVBPrint *bp)
 

Variables

static const char cond_names [16][4]
 
static const char insn_names [AARCH64_INSN_NB][8]
 

Macro Definition Documentation

◆ INSTR_INDENT

#define INSTR_INDENT   8

Static file backend for the runtime assembler.

Emits GNU assembler text targeted to AArch64.

Definition at line 38 of file rasm_print.c.

Referenced by print_node_comment(), and print_node_insn().

◆ COMMENT_COL

#define COMMENT_COL   56

Definition at line 39 of file rasm_print.c.

Referenced by rasm_print().

Function Documentation

◆ indent_to()

static void indent_to ( AVBPrint * bp,
unsigned line_start,
int col )
static

Definition at line 41 of file rasm_print.c.

Referenced by print_node_comment(), print_node_insn(), and rasm_print().

◆ print_op_imm()

static void print_op_imm ( AVBPrint * bp,
RasmOp op )
static

Definition at line 50 of file rasm_print.c.

Referenced by print_op().

◆ print_op_label()

static void print_op_label ( const RasmContext * rctx,
AVBPrint * bp,
RasmOp op,
const int * local_labels )
static

Definition at line 58 of file rasm_print.c.

Referenced by print_op().

◆ print_op_gpr()

static void print_op_gpr ( AVBPrint * bp,
RasmOp op )
static

Definition at line 79 of file rasm_print.c.

Referenced by print_op().

◆ elem_type_char()

static char elem_type_char ( uint8_t elem_size)
static

Definition at line 100 of file rasm_print.c.

Referenced by print_vec_reg().

◆ print_vec_reg()

static void print_vec_reg ( AVBPrint * bp,
uint8_t n,
uint8_t el_count,
uint8_t el_size,
uint8_t idx_p1 )
static

Definition at line 113 of file rasm_print.c.

Referenced by print_op_vec().

◆ print_op_vec()

static void print_op_vec ( AVBPrint * bp,
RasmOp op )
static

Definition at line 127 of file rasm_print.c.

Referenced by print_op().

◆ print_base_reg()

static void print_base_reg ( AVBPrint * bp,
uint8_t n )
static

Definition at line 151 of file rasm_print.c.

Referenced by print_op_base().

◆ print_op_base()

static void print_op_base ( AVBPrint * bp,
RasmOp op )
static

Definition at line 159 of file rasm_print.c.

Referenced by print_op().

◆ cond_name()

static const char * cond_name ( uint8_t cond)
static

Definition at line 210 of file rasm_print.c.

Referenced by print_node_insn(), and print_op_cond().

◆ print_op_cond()

static void print_op_cond ( AVBPrint * bp,
RasmOp op )
static

Definition at line 219 of file rasm_print.c.

Referenced by print_op().

◆ print_op()

static void print_op ( const RasmContext * rctx,
AVBPrint * bp,
const int * local_labels,
RasmOp op )
static

Definition at line 227 of file rasm_print.c.

Referenced by main(), and print_node_insn().

◆ insn_name()

static const char * insn_name ( int id)
static

Definition at line 320 of file rasm_print.c.

Referenced by print_node_insn().

◆ print_node_insn()

static void print_node_insn ( const RasmContext * rctx,
AVBPrint * bp,
unsigned line_start,
const RasmNode * node,
const int * local_labels )
static

Definition at line 329 of file rasm_print.c.

Referenced by rasm_print().

◆ print_node_comment()

static void print_node_comment ( const RasmContext * rctx,
AVBPrint * bp,
unsigned line_start,
const RasmNode * node )
static

Definition at line 359 of file rasm_print.c.

Referenced by rasm_print().

◆ print_node_label()

static void print_node_label ( const RasmContext * rctx,
AVBPrint * bp,
unsigned line_start,
const RasmNode * node,
int * local_labels )
static

Definition at line 370 of file rasm_print.c.

Referenced by rasm_print().

◆ print_node_function()

static void print_node_function ( const RasmContext * rctx,
AVBPrint * bp,
unsigned line_start,
const RasmNode * node )
static

Definition at line 393 of file rasm_print.c.

Referenced by rasm_print().

◆ print_node_endfunc()

static void print_node_endfunc ( const RasmContext * rctx,
AVBPrint * bp,
unsigned line_start,
const RasmNode * node )
static

Definition at line 404 of file rasm_print.c.

Referenced by rasm_print().

◆ print_node_directive()

static void print_node_directive ( const RasmContext * rctx,
AVBPrint * bp,
unsigned line_start,
const RasmNode * node )
static

Definition at line 414 of file rasm_print.c.

Referenced by rasm_print().

◆ rasm_print()

int rasm_print ( RasmContext * rctx,
AVBPrint * bp )

Definition at line 422 of file rasm_print.c.

Referenced by asmgen(), and rasm_annotate_nextf().

Variable Documentation

◆ cond_names

const char cond_names[16][4]
static
Initial value:
= {
[AARCH64_COND_EQ] = "eq",
[AARCH64_COND_NE] = "ne",
[AARCH64_COND_HS] = "hs",
[AARCH64_COND_LO] = "lo",
[AARCH64_COND_MI] = "mi",
[AARCH64_COND_PL] = "pl",
[AARCH64_COND_VS] = "vs",
[AARCH64_COND_VC] = "vc",
[AARCH64_COND_HI] = "hi",
[AARCH64_COND_LS] = "ls",
[AARCH64_COND_GE] = "ge",
[AARCH64_COND_LT] = "lt",
[AARCH64_COND_GT] = "gt",
[AARCH64_COND_LE] = "le",
[AARCH64_COND_AL] = "al",
[AARCH64_COND_NV] = "nv",
}
#define AARCH64_COND_MI
Definition rasm.h:327
#define AARCH64_COND_LO
Definition rasm.h:325
#define AARCH64_COND_AL
Definition rasm.h:337
#define AARCH64_COND_NV
Definition rasm.h:338
#define AARCH64_COND_VC
Definition rasm.h:330
#define AARCH64_COND_EQ
Definition rasm.h:321
#define AARCH64_COND_HS
Definition rasm.h:323
#define AARCH64_COND_LE
Definition rasm.h:336
#define AARCH64_COND_GE
Definition rasm.h:333
#define AARCH64_COND_NE
Definition rasm.h:322
#define AARCH64_COND_LT
Definition rasm.h:334
#define AARCH64_COND_PL
Definition rasm.h:328
#define AARCH64_COND_LS
Definition rasm.h:332
#define AARCH64_COND_VS
Definition rasm.h:329
#define AARCH64_COND_GT
Definition rasm.h:335
#define AARCH64_COND_HI
Definition rasm.h:331

Definition at line 191 of file rasm_print.c.

Referenced by cond_name().

◆ insn_names

const char insn_names[AARCH64_INSN_NB][8]
static

Definition at line 258 of file rasm_print.c.

Referenced by insn_name().