FFmpeg
Macros | Functions | Variables
rasm_print.c File Reference
#include <stdarg.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. More...
 
#define COMMENT_COL   56
 

Functions

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

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 35 of file rasm_print.c.

◆ COMMENT_COL

#define COMMENT_COL   56

Definition at line 36 of file rasm_print.c.

Function Documentation

◆ av_printf_format()

av_printf_format ( ,
 
)

Definition at line 38 of file rasm_print.c.

◆ indent_to()

static void indent_to ( FILE *  fp,
int64_t pos,
int64_t  line_start,
int  col 
)
static

Definition at line 51 of file rasm_print.c.

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

◆ print_op_imm()

static void print_op_imm ( FILE *  fp,
int64_t pos,
RasmOp  op 
)
static

Definition at line 60 of file rasm_print.c.

Referenced by print_op().

◆ print_op_label()

static void print_op_label ( const RasmContext rctx,
FILE *  fp,
int64_t pos,
RasmOp  op,
const int *  local_labels 
)
static

Definition at line 68 of file rasm_print.c.

Referenced by print_op().

◆ print_op_gpr()

static void print_op_gpr ( FILE *  fp,
int64_t pos,
RasmOp  op 
)
static

Definition at line 89 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 110 of file rasm_print.c.

Referenced by print_vec_reg().

◆ print_vec_reg()

static void print_vec_reg ( FILE *  fp,
int64_t pos,
uint8_t  n,
uint8_t  el_count,
uint8_t  el_size,
uint8_t  idx_p1 
)
static

Definition at line 123 of file rasm_print.c.

Referenced by print_op_vec().

◆ print_op_vec()

static void print_op_vec ( FILE *  fp,
int64_t pos,
RasmOp  op 
)
static

Definition at line 137 of file rasm_print.c.

Referenced by print_op().

◆ print_base_reg()

static void print_base_reg ( FILE *  fp,
int64_t pos,
uint8_t  n 
)
static

Definition at line 161 of file rasm_print.c.

Referenced by print_op_base().

◆ print_op_base()

static void print_op_base ( FILE *  fp,
int64_t pos,
RasmOp  op 
)
static

Definition at line 169 of file rasm_print.c.

Referenced by print_op().

◆ cond_name()

static const char* cond_name ( uint8_t  cond)
static

Definition at line 220 of file rasm_print.c.

Referenced by print_node_insn(), and print_op_cond().

◆ print_op_cond()

static void print_op_cond ( FILE *  fp,
int64_t pos,
RasmOp  op 
)
static

Definition at line 229 of file rasm_print.c.

Referenced by print_op().

◆ print_op()

static void print_op ( const RasmContext rctx,
FILE *  fp,
int64_t pos,
const int *  local_labels,
RasmOp  op 
)
static

Definition at line 237 of file rasm_print.c.

Referenced by print_node_insn().

◆ insn_name()

static const char* insn_name ( int  id)
static

Definition at line 328 of file rasm_print.c.

Referenced by print_node_insn().

◆ print_node_insn()

static void print_node_insn ( const RasmContext rctx,
FILE *  fp,
int64_t pos,
int64_t  line_start,
const RasmNode node,
const int *  local_labels 
)
static

Definition at line 337 of file rasm_print.c.

Referenced by rasm_print().

◆ print_node_comment()

static void print_node_comment ( const RasmContext rctx,
FILE *  fp,
int64_t pos,
int64_t  line_start,
const RasmNode node 
)
static

Definition at line 367 of file rasm_print.c.

Referenced by rasm_print().

◆ print_node_label()

static void print_node_label ( const RasmContext rctx,
FILE *  fp,
int64_t pos,
int64_t  line_start,
const RasmNode node,
int *  local_labels 
)
static

Definition at line 378 of file rasm_print.c.

Referenced by rasm_print().

◆ print_node_function()

static void print_node_function ( const RasmContext rctx,
FILE *  fp,
int64_t pos,
int64_t  line_start,
const RasmNode node 
)
static

Definition at line 401 of file rasm_print.c.

Referenced by rasm_print().

◆ print_node_endfunc()

static void print_node_endfunc ( const RasmContext rctx,
FILE *  fp,
int64_t pos,
int64_t  line_start,
const RasmNode node 
)
static

Definition at line 412 of file rasm_print.c.

Referenced by rasm_print().

◆ print_node_directive()

static void print_node_directive ( const RasmContext rctx,
FILE *  fp,
int64_t pos,
int64_t  line_start,
const RasmNode node 
)
static

Definition at line 422 of file rasm_print.c.

Referenced by rasm_print().

◆ rasm_print()

int rasm_print ( RasmContext rctx,
FILE *  fp 
)

Definition at line 430 of file rasm_print.c.

Referenced by asmgen().

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",
}

Definition at line 201 of file rasm_print.c.

Referenced by cond_name().

◆ insn_names

const char insn_names[AARCH64_INSN_NB][8]
static

Definition at line 268 of file rasm_print.c.

Referenced by insn_name().

AARCH64_COND_NE
#define AARCH64_COND_NE
Definition: rasm.h:319
AARCH64_COND_GE
#define AARCH64_COND_GE
Definition: rasm.h:330
AARCH64_COND_AL
#define AARCH64_COND_AL
Definition: rasm.h:334
AARCH64_COND_NV
#define AARCH64_COND_NV
Definition: rasm.h:335
AARCH64_COND_LT
#define AARCH64_COND_LT
Definition: rasm.h:331
AARCH64_COND_HI
#define AARCH64_COND_HI
Definition: rasm.h:328
AARCH64_COND_LS
#define AARCH64_COND_LS
Definition: rasm.h:329
AARCH64_COND_LE
#define AARCH64_COND_LE
Definition: rasm.h:333
AARCH64_COND_PL
#define AARCH64_COND_PL
Definition: rasm.h:325
AARCH64_COND_HS
#define AARCH64_COND_HS
Definition: rasm.h:320
AARCH64_COND_EQ
#define AARCH64_COND_EQ
Definition: rasm.h:318
AARCH64_COND_GT
#define AARCH64_COND_GT
Definition: rasm.h:332
AARCH64_COND_LO
#define AARCH64_COND_LO
Definition: rasm.h:322
AARCH64_COND_VS
#define AARCH64_COND_VS
Definition: rasm.h:326
AARCH64_COND_MI
#define AARCH64_COND_MI
Definition: rasm.h:324
AARCH64_COND_VC
#define AARCH64_COND_VC
Definition: rasm.h:327