FFmpeg
Loading...
Searching...
No Matches
rasm_print.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2026 Ramiro Polla
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <stdarg.h>
22#include <string.h>
23
24#include "libavutil/bprint.h"
25#include "libavutil/error.h"
26#include "libavutil/mem.h"
27
28#include "rasm.h"
29
30/**
31 * Static file backend for the runtime assembler. Emits GNU assembler
32 * text targeted to AArch64.
33 */
34
35/*********************************************************************/
36/* Values from tools/indent_arm_assembly.pl */
37
38#define INSTR_INDENT 8
39#define COMMENT_COL 56
40
41static void indent_to(AVBPrint *bp, unsigned line_start, int col)
42{
43 int cur_col = bp->len - line_start;
44 av_bprintf(bp, "%*s", FFMAX(col - cur_col, 1), "");
45}
46
47/*********************************************************************/
48/* RASM_OP_IMM */
49
50static void print_op_imm(AVBPrint *bp, RasmOp op)
51{
52 av_bprintf(bp, "#%d", rasm_op_imm_val(op));
53}
54
55/*********************************************************************/
56/* RASM_OP_LABEL */
57
58static void print_op_label(const RasmContext *rctx,
59 AVBPrint *bp,
60 RasmOp op, const int *local_labels)
61{
62 int id = rasm_op_label_id(op);
63 av_assert0(id >= 0 && id < rctx->num_labels);
64 if (rctx->labels[id]) {
65 av_bprintf(bp, "%s", rctx->labels[id]);
66 } else {
67 int local_id = local_labels[id];
68 if (local_id < 0) {
69 av_bprintf(bp, "%db", -local_id);
70 } else {
71 av_bprintf(bp, "%df", local_id);
72 }
73 }
74}
75
76/*********************************************************************/
77/* AARCH64_OP_GPR */
78
79static void print_op_gpr(AVBPrint *bp, RasmOp op)
80{
81 uint8_t n = a64op_gpr_n(op);
82 uint8_t size = a64op_gpr_size(op);
83
84 if (n == 31) {
85 av_bprintf(bp, "%s", size == sizeof(uint32_t) ? "wsp" : "sp");
86 return;
87 }
88
89 switch (size) {
90 case sizeof(uint32_t): av_bprintf(bp, "w%d", n); break;
91 case sizeof(uint64_t): av_bprintf(bp, "x%d", n); break;
92 default:
93 av_assert0(!"Invalid GPR size!");
94 }
95}
96
97/*********************************************************************/
98/* AARCH64_OP_VEC */
99
100static char elem_type_char(uint8_t elem_size)
101{
102 switch (elem_size) {
103 case 1: return 'b';
104 case 2: return 'h';
105 case 4: return 's';
106 case 8: return 'd';
107 case 16: return 'q';
108 }
109 av_assert0(!"Invalid vector element type!");
110 return '\0';
111}
112
113static void print_vec_reg(AVBPrint *bp,
114 uint8_t n, uint8_t el_count, uint8_t el_size, uint8_t idx_p1)
115{
116 if (el_size == 0) {
117 av_bprintf(bp, "v%u", n);
118 } else if (el_count != 0) {
119 av_bprintf(bp, "v%u.%d%c", n, el_count, elem_type_char(el_size));
120 } else if (idx_p1) {
121 av_bprintf(bp, "v%u.%c[%u]", n, elem_type_char(el_size), idx_p1 - 1);
122 } else {
123 av_bprintf(bp, "%c%u", elem_type_char(el_size), n);
124 }
125}
126
127static void print_op_vec(AVBPrint *bp, RasmOp op)
128{
129 uint8_t n = a64op_vec_n(op);
130 uint8_t el_count = a64op_vec_el_count(op);
131 uint8_t el_size = a64op_vec_el_size(op);
132 uint8_t num_regs = a64op_vec_num_regs(op);
133
134 if (num_regs) {
135 av_bprintf(bp, "{");
136 for (int i = 0; i < num_regs; i++) {
137 if (i > 0)
138 av_bprintf(bp, ", ");
139 print_vec_reg(bp, (n + i) & 0x1f, el_count, el_size, 0);
140 }
141 av_bprintf(bp, "}");
142 } else {
143 uint8_t idx_p1 = a64op_vec_idx_p1(op);
144 print_vec_reg(bp, n, el_count, el_size, idx_p1);
145 }
146}
147
148/*********************************************************************/
149/* AARCH64_OP_BASE */
150
151static void print_base_reg(AVBPrint *bp, uint8_t n)
152{
153 if (n == 31)
154 av_bprintf(bp, "sp");
155 else
156 av_bprintf(bp, "x%d", n);
157}
158
159static void print_op_base(AVBPrint *bp, RasmOp op)
160{
161 uint8_t n = a64op_base_n(op);
162 uint8_t mode = a64op_base_mode(op);
163 int16_t imm = a64op_base_imm(op);
164
165 switch (mode) {
166 case AARCH64_BASE_OFFSET: {
167 av_bprintf(bp, "[");
168 print_base_reg(bp, n);
169 if (imm)
170 av_bprintf(bp, ", #%d]", imm);
171 else
172 av_bprintf(bp, "]");
173 break;
174 }
175 case AARCH64_BASE_PRE:
176 av_bprintf(bp, "[");
177 print_base_reg(bp, n);
178 av_bprintf(bp, ", #%d]!", imm);
179 break;
181 av_bprintf(bp, "[");
182 print_base_reg(bp, n);
183 av_bprintf(bp, "], #%d", imm);
184 break;
185 }
186}
187
188/*********************************************************************/
189/* AARCH64_OP_COND */
190
191static const char cond_names[16][4] = {
192 [AARCH64_COND_EQ] = "eq",
193 [AARCH64_COND_NE] = "ne",
194 [AARCH64_COND_HS] = "hs",
195 [AARCH64_COND_LO] = "lo",
196 [AARCH64_COND_MI] = "mi",
197 [AARCH64_COND_PL] = "pl",
198 [AARCH64_COND_VS] = "vs",
199 [AARCH64_COND_VC] = "vc",
200 [AARCH64_COND_HI] = "hi",
201 [AARCH64_COND_LS] = "ls",
202 [AARCH64_COND_GE] = "ge",
203 [AARCH64_COND_LT] = "lt",
204 [AARCH64_COND_GT] = "gt",
205 [AARCH64_COND_LE] = "le",
206 [AARCH64_COND_AL] = "al",
207 [AARCH64_COND_NV] = "nv",
208};
209
210static const char *cond_name(uint8_t cond)
211{
212 if (cond >= 16) {
213 av_assert0(!"Invalid cond type!");
214 return NULL;
215 }
216 return cond_names[cond];
217}
218
219static void print_op_cond(AVBPrint *bp, RasmOp op)
220{
222}
223
224/*********************************************************************/
225/* Instruction operands */
226
227static void print_op(const RasmContext *rctx,
228 AVBPrint *bp,
229 const int *local_labels, RasmOp op)
230{
231 switch (rasm_op_type(op)) {
232 case RASM_OP_IMM:
233 print_op_imm(bp, op);
234 break;
235 case RASM_OP_LABEL:
236 print_op_label(rctx, bp, op, local_labels);
237 break;
238 case AARCH64_OP_GPR:
239 print_op_gpr(bp, op);
240 break;
241 case AARCH64_OP_VEC:
242 print_op_vec(bp, op);
243 break;
244 case AARCH64_OP_BASE:
245 print_op_base(bp, op);
246 break;
247 case AARCH64_OP_COND:
248 print_op_cond(bp, op);
249 break;
250 default:
251 av_assert0(0);
252 }
253}
254
255/*********************************************************************/
256/* RASM_NODE_INSN */
257
258static const char insn_names[AARCH64_INSN_NB][8] = {
259 [AARCH64_INSN_ADD ] = "add",
260 [AARCH64_INSN_ADDV ] = "addv",
261 [AARCH64_INSN_ADR ] = "adr",
262 [AARCH64_INSN_AND ] = "and",
263 [AARCH64_INSN_B ] = "b",
264 [AARCH64_INSN_BCOND ] = "b",
265 [AARCH64_INSN_BLR ] = "blr",
266 [AARCH64_INSN_BR ] = "br",
267 [AARCH64_INSN_CMP ] = "cmp",
268 [AARCH64_INSN_CSEL ] = "csel",
269 [AARCH64_INSN_DUP ] = "dup",
270 [AARCH64_INSN_FADD ] = "fadd",
271 [AARCH64_INSN_FCVTZU] = "fcvtzu",
272 [AARCH64_INSN_FMAX ] = "fmax",
273 [AARCH64_INSN_FMIN ] = "fmin",
274 [AARCH64_INSN_FMLA ] = "fmla",
275 [AARCH64_INSN_FMUL ] = "fmul",
276 [AARCH64_INSN_INS ] = "ins",
277 [AARCH64_INSN_LD1 ] = "ld1",
278 [AARCH64_INSN_LD1R ] = "ld1r",
279 [AARCH64_INSN_LD2 ] = "ld2",
280 [AARCH64_INSN_LD3 ] = "ld3",
281 [AARCH64_INSN_LD4 ] = "ld4",
282 [AARCH64_INSN_LDP ] = "ldp",
283 [AARCH64_INSN_LDR ] = "ldr",
284 [AARCH64_INSN_LDRB ] = "ldrb",
285 [AARCH64_INSN_LDRH ] = "ldrh",
286 [AARCH64_INSN_LSR ] = "lsr",
287 [AARCH64_INSN_MOV ] = "mov",
288 [AARCH64_INSN_MOVI ] = "movi",
289 [AARCH64_INSN_MUL ] = "mul",
290 [AARCH64_INSN_ORR ] = "orr",
291 [AARCH64_INSN_RET ] = "ret",
292 [AARCH64_INSN_REV16 ] = "rev16",
293 [AARCH64_INSN_REV32 ] = "rev32",
294 [AARCH64_INSN_SHL ] = "shl",
295 [AARCH64_INSN_ST1 ] = "st1",
296 [AARCH64_INSN_ST2 ] = "st2",
297 [AARCH64_INSN_ST3 ] = "st3",
298 [AARCH64_INSN_ST4 ] = "st4",
299 [AARCH64_INSN_STP ] = "stp",
300 [AARCH64_INSN_STR ] = "str",
301 [AARCH64_INSN_SUB ] = "sub",
302 [AARCH64_INSN_SUBS ] = "subs",
303 [AARCH64_INSN_TBL ] = "tbl",
304 [AARCH64_INSN_UBFIZ ] = "ubfiz",
305 [AARCH64_INSN_UCVTF ] = "ucvtf",
306 [AARCH64_INSN_UMAX ] = "umax",
307 [AARCH64_INSN_UMIN ] = "umin",
308 [AARCH64_INSN_UQXTN ] = "uqxtn",
309 [AARCH64_INSN_USHL ] = "ushl",
310 [AARCH64_INSN_USHLL ] = "ushll",
311 [AARCH64_INSN_USHLL2] = "ushll2",
312 [AARCH64_INSN_USHR ] = "ushr",
313 [AARCH64_INSN_UXTL ] = "uxtl",
314 [AARCH64_INSN_UXTL2 ] = "uxtl2",
315 [AARCH64_INSN_XTN ] = "xtn",
316 [AARCH64_INSN_ZIP1 ] = "zip1",
317 [AARCH64_INSN_ZIP2 ] = "zip2",
318};
319
320static const char *insn_name(int id)
321{
322 if (id == AARCH64_INSN_NONE || id >= AARCH64_INSN_NB) {
323 av_assert0(!"Invalid insn type!");
324 return NULL;
325 }
326 return insn_names[id];
327}
328
329static void print_node_insn(const RasmContext *rctx,
330 AVBPrint *bp, unsigned line_start,
331 const RasmNode *node,
332 const int *local_labels)
333{
334 indent_to(bp, line_start, INSTR_INDENT);
335
336 int op_start = 0;
337 if (node->insn.id == AARCH64_INSN_BCOND) {
338 av_bprintf(bp, "b.%-14s", cond_name(a64op_cond_val(node->insn.op[0])));
339 op_start = 1;
340 } else if (rasm_op_type(node->insn.op[0]) == RASM_OP_NONE) {
341 av_bprintf(bp, "%s", insn_name(node->insn.id));
342 } else {
343 av_bprintf(bp, "%-16s", insn_name(node->insn.id));
344 }
345
346 for (int j = op_start; j < 4; j++) {
347 RasmOp op = node->insn.op[j];
349 break;
350 if (j != op_start)
351 av_bprintf(bp, ", ");
352 print_op(rctx, bp, local_labels, op);
353 }
354}
355
356/*********************************************************************/
357/* RASM_NODE_COMMENT */
358
359static void print_node_comment(const RasmContext *rctx,
360 AVBPrint *bp, unsigned line_start,
361 const RasmNode *node)
362{
363 indent_to(bp, line_start, INSTR_INDENT);
364 av_bprintf(bp, "// %s", node->comment.text);
365}
366
367/*********************************************************************/
368/* RASM_NODE_LABEL */
369
370static void print_node_label(const RasmContext *rctx,
371 AVBPrint *bp, unsigned line_start,
372 const RasmNode *node,
373 int *local_labels)
374{
375 int id = node->label.id;
376 if (rctx->labels[id]) {
377 av_bprintf(bp, "%s:", rctx->labels[id]);
378 } else {
379 /* Local label. */
380 int local_id = local_labels[id];
381 if (local_id < 0) {
382 av_bprintf(bp, "%d:", -local_id);
383 } else {
384 av_bprintf(bp, "%d:", local_id);
385 local_labels[id] = -local_id;
386 }
387 }
388}
389
390/*********************************************************************/
391/* RASM_NODE_FUNCTION */
392
393static void print_node_function(const RasmContext *rctx,
394 AVBPrint *bp, unsigned line_start,
395 const RasmNode *node)
396{
397 av_bprintf(bp, "function %s, export=%d, jumpable=%d",
398 node->func.name, node->func.export, node->func.jumpable);
399}
400
401/*********************************************************************/
402/* RASM_NODE_ENDFUNC */
403
404static void print_node_endfunc(const RasmContext *rctx,
405 AVBPrint *bp, unsigned line_start,
406 const RasmNode *node)
407{
408 av_bprintf(bp, "endfunc");
409}
410
411/*********************************************************************/
412/* RASM_NODE_DIRECTIVE */
413
414static void print_node_directive(const RasmContext *rctx,
415 AVBPrint *bp, unsigned line_start,
416 const RasmNode *node)
417{
418 av_bprintf(bp, "%s", node->directive.text);
419}
420
421/*********************************************************************/
422int rasm_print(RasmContext *rctx, AVBPrint *bp)
423{
424 if (rctx->error)
425 return rctx->error;
426
427 /* Helper array to assign numbers and track position of local labels. */
428 int *local_labels = NULL;
429 if (rctx->num_labels) {
430 local_labels = av_malloc(rctx->num_labels * sizeof(*local_labels));
431 if (!local_labels)
432 return AVERROR(ENOMEM);
433 }
434
435 for (int i = 0; i < rctx->num_entries; i++) {
436 const RasmEntry *entry = &rctx->entries[i];
437
438 /* Assign numbers to local labels in this entry. */
439 if (rctx->num_labels) {
440 int local_label = 1;
441 memset(local_labels, 0x00, rctx->num_labels * sizeof(*local_labels));
442 for (const RasmNode *node = entry->start; node != NULL; node = node->next) {
443 if (node->type == RASM_NODE_LABEL) {
444 int id = node->label.id;
445 if (!rctx->labels[id])
446 local_labels[id] = local_label++;
447 }
448 }
449 }
450
451 for (const RasmNode *node = entry->start; node != NULL; node = node->next) {
452 unsigned line_start = bp->len;
453
454 switch (node->type) {
455 case RASM_NODE_INSN:
456 print_node_insn(rctx, bp, line_start, node, local_labels);
457 break;
459 print_node_comment(rctx, bp, line_start, node);
460 break;
461 case RASM_NODE_LABEL:
462 print_node_label(rctx, bp, line_start, node, local_labels);
463 break;
465 print_node_function(rctx, bp, line_start, node);
466 break;
468 print_node_endfunc(rctx, bp, line_start, node);
469 break;
471 print_node_directive(rctx, bp, line_start, node);
472 break;
473 default:
474 break;
475 }
476
477 if (node->inline_comment) {
478 indent_to(bp, line_start, COMMENT_COL);
479 av_bprintf(bp, "// %s", node->inline_comment);
480 }
481 av_bprintf(bp, "\n");
482
483 /* Add extra line after end of functions. */
484 if (node->type == RASM_NODE_ENDFUNC)
485 av_bprintf(bp, "\n");
486 }
487 }
488
489 av_freep(&local_labels);
490
491 return 0;
492}
#define entry
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition avassert.h:42
void av_bprintf(AVBPrint *buf, const char *fmt,...)
Definition bprint.c:122
AVBPrint public header.
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define NULL
Definition coverity.c:32
enum AVCodecID id
Definition dts2pts.c:607
error code definitions
#define AVERROR(e)
Definition error.h:45
static int op(uint8_t **dst, const uint8_t *dst_end, GetByteContext *gb, int pixel, int count, int *x, int width, int linesize)
Perform decode operation.
Definition anm.c:76
#define FFMAX(a, b)
Definition macros.h:47
Memory handling functions.
#define av_malloc(s)
Definition ops_static.c:52
int(* cond)(enum AVPixelFormat pix_fmt)
@ RASM_NODE_DIRECTIVE
Definition rasm.h:117
@ RASM_NODE_FUNCTION
Definition rasm.h:115
@ RASM_NODE_ENDFUNC
Definition rasm.h:116
@ RASM_NODE_LABEL
Definition rasm.h:114
@ RASM_NODE_INSN
Definition rasm.h:112
@ RASM_NODE_COMMENT
Definition rasm.h:113
#define AARCH64_BASE_PRE
Definition rasm.h:490
#define AARCH64_BASE_OFFSET
Definition rasm.h:489
static uint8_t a64op_gpr_n(RasmOp op)
Definition rasm.h:351
static int rasm_op_label_id(RasmOp op)
Definition rasm.h:103
static uint8_t a64op_cond_val(RasmOp op)
Definition rasm.h:521
#define AARCH64_COND_MI
Definition rasm.h:327
static uint8_t a64op_gpr_size(RasmOp op)
Definition rasm.h:352
@ RASM_OP_LABEL
Definition rasm.h:65
@ RASM_OP_IMM
Definition rasm.h:64
@ RASM_OP_NONE
Definition rasm.h:63
#define AARCH64_BASE_POST
Definition rasm.h:491
#define AARCH64_COND_LO
Definition rasm.h:325
static int16_t a64op_base_imm(RasmOp op)
Definition rasm.h:502
static uint8_t rasm_op_type(RasmOp op)
Definition rasm.h:58
static uint8_t a64op_base_mode(RasmOp op)
Definition rasm.h:504
static uint8_t a64op_vec_num_regs(RasmOp op)
Definition rasm.h:380
#define AARCH64_COND_AL
Definition rasm.h:337
#define AARCH64_COND_NV
Definition rasm.h:338
#define AARCH64_COND_VC
Definition rasm.h:330
static uint8_t a64op_vec_idx_p1(RasmOp op)
Definition rasm.h:381
static int32_t rasm_op_imm_val(RasmOp op)
Definition rasm.h:87
#define AARCH64_COND_EQ
Definition rasm.h:321
static uint8_t a64op_vec_n(RasmOp op)
Definition rasm.h:377
#define AARCH64_COND_HS
Definition rasm.h:323
#define AARCH64_COND_LE
Definition rasm.h:336
#define AARCH64_COND_GE
Definition rasm.h:333
@ AARCH64_OP_BASE
Definition rasm.h:314
@ AARCH64_OP_GPR
Definition rasm.h:312
@ AARCH64_OP_COND
Definition rasm.h:315
@ AARCH64_OP_VEC
Definition rasm.h:313
#define AARCH64_COND_NE
Definition rasm.h:322
#define AARCH64_COND_LT
Definition rasm.h:334
#define AARCH64_COND_PL
Definition rasm.h:328
static uint8_t a64op_base_n(RasmOp op)
Definition rasm.h:503
@ AARCH64_INSN_UMIN
Definition rasm.h:295
@ AARCH64_INSN_MOVI
Definition rasm.h:276
@ AARCH64_INSN_FMIN
Definition rasm.h:261
@ AARCH64_INSN_LDR
Definition rasm.h:271
@ AARCH64_INSN_UXTL2
Definition rasm.h:302
@ AARCH64_INSN_NB
Definition rasm.h:307
@ AARCH64_INSN_ST4
Definition rasm.h:286
@ AARCH64_INSN_REV16
Definition rasm.h:280
@ AARCH64_INSN_ZIP2
Definition rasm.h:305
@ AARCH64_INSN_BCOND
Definition rasm.h:252
@ AARCH64_INSN_UMAX
Definition rasm.h:294
@ AARCH64_INSN_TBL
Definition rasm.h:291
@ AARCH64_INSN_USHR
Definition rasm.h:300
@ AARCH64_INSN_LDRB
Definition rasm.h:272
@ AARCH64_INSN_B
Definition rasm.h:251
@ AARCH64_INSN_STP
Definition rasm.h:287
@ AARCH64_INSN_ADDV
Definition rasm.h:248
@ AARCH64_INSN_ADR
Definition rasm.h:249
@ AARCH64_INSN_USHL
Definition rasm.h:297
@ AARCH64_INSN_AND
Definition rasm.h:250
@ AARCH64_INSN_ORR
Definition rasm.h:278
@ AARCH64_INSN_SUB
Definition rasm.h:289
@ AARCH64_INSN_REV32
Definition rasm.h:281
@ AARCH64_INSN_UXTL
Definition rasm.h:301
@ AARCH64_INSN_INS
Definition rasm.h:264
@ AARCH64_INSN_NONE
Definition rasm.h:245
@ AARCH64_INSN_ST1
Definition rasm.h:283
@ AARCH64_INSN_FMAX
Definition rasm.h:260
@ AARCH64_INSN_LD1
Definition rasm.h:265
@ AARCH64_INSN_BR
Definition rasm.h:254
@ AARCH64_INSN_ADD
Definition rasm.h:247
@ AARCH64_INSN_SUBS
Definition rasm.h:290
@ AARCH64_INSN_LDP
Definition rasm.h:270
@ AARCH64_INSN_LD1R
Definition rasm.h:266
@ AARCH64_INSN_LD3
Definition rasm.h:268
@ AARCH64_INSN_FCVTZU
Definition rasm.h:259
@ AARCH64_INSN_FADD
Definition rasm.h:258
@ AARCH64_INSN_ST2
Definition rasm.h:284
@ AARCH64_INSN_UBFIZ
Definition rasm.h:292
@ AARCH64_INSN_CSEL
Definition rasm.h:256
@ AARCH64_INSN_CMP
Definition rasm.h:255
@ AARCH64_INSN_LSR
Definition rasm.h:274
@ AARCH64_INSN_LDRH
Definition rasm.h:273
@ AARCH64_INSN_ST3
Definition rasm.h:285
@ AARCH64_INSN_DUP
Definition rasm.h:257
@ AARCH64_INSN_ZIP1
Definition rasm.h:304
@ AARCH64_INSN_BLR
Definition rasm.h:253
@ AARCH64_INSN_STR
Definition rasm.h:288
@ AARCH64_INSN_LD4
Definition rasm.h:269
@ AARCH64_INSN_FMLA
Definition rasm.h:262
@ AARCH64_INSN_UQXTN
Definition rasm.h:296
@ AARCH64_INSN_FMUL
Definition rasm.h:263
@ AARCH64_INSN_RET
Definition rasm.h:279
@ AARCH64_INSN_USHLL2
Definition rasm.h:299
@ AARCH64_INSN_MOV
Definition rasm.h:275
@ AARCH64_INSN_LD2
Definition rasm.h:267
@ AARCH64_INSN_UCVTF
Definition rasm.h:293
@ AARCH64_INSN_USHLL
Definition rasm.h:298
@ AARCH64_INSN_SHL
Definition rasm.h:282
@ AARCH64_INSN_MUL
Definition rasm.h:277
@ AARCH64_INSN_XTN
Definition rasm.h:303
#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
static uint8_t a64op_vec_el_count(RasmOp op)
Definition rasm.h:378
static uint8_t a64op_vec_el_size(RasmOp op)
Definition rasm.h:379
static void print_node_endfunc(const RasmContext *rctx, AVBPrint *bp, unsigned line_start, const RasmNode *node)
Definition rasm_print.c:404
static void indent_to(AVBPrint *bp, unsigned line_start, int col)
Definition rasm_print.c:41
static void print_node_label(const RasmContext *rctx, AVBPrint *bp, unsigned line_start, const RasmNode *node, int *local_labels)
Definition rasm_print.c:370
static const char insn_names[AARCH64_INSN_NB][8]
Definition rasm_print.c:258
static const char * cond_name(uint8_t cond)
Definition rasm_print.c:210
static void print_op_vec(AVBPrint *bp, RasmOp op)
Definition rasm_print.c:127
static const char * insn_name(int id)
Definition rasm_print.c:320
static void print_op_cond(AVBPrint *bp, RasmOp op)
Definition rasm_print.c:219
static void print_node_directive(const RasmContext *rctx, AVBPrint *bp, unsigned line_start, const RasmNode *node)
Definition rasm_print.c:414
#define INSTR_INDENT
Static file backend for the runtime assembler.
Definition rasm_print.c:38
static const char cond_names[16][4]
Definition rasm_print.c:191
static void print_op_base(AVBPrint *bp, RasmOp op)
Definition rasm_print.c:159
int rasm_print(RasmContext *rctx, AVBPrint *bp)
Definition rasm_print.c:422
static char elem_type_char(uint8_t elem_size)
Definition rasm_print.c:100
static void print_node_function(const RasmContext *rctx, AVBPrint *bp, unsigned line_start, const RasmNode *node)
Definition rasm_print.c:393
static void print_node_comment(const RasmContext *rctx, AVBPrint *bp, unsigned line_start, const RasmNode *node)
Definition rasm_print.c:359
static void print_op_imm(AVBPrint *bp, RasmOp op)
Definition rasm_print.c:50
#define COMMENT_COL
Definition rasm_print.c:39
static void print_op_gpr(AVBPrint *bp, RasmOp op)
Definition rasm_print.c:79
static void print_op_label(const RasmContext *rctx, AVBPrint *bp, RasmOp op, const int *local_labels)
Definition rasm_print.c:58
static void print_op(const RasmContext *rctx, AVBPrint *bp, const int *local_labels, RasmOp op)
Definition rasm_print.c:227
static void print_node_insn(const RasmContext *rctx, AVBPrint *bp, unsigned line_start, const RasmNode *node, const int *local_labels)
Definition rasm_print.c:329
static void print_vec_reg(AVBPrint *bp, uint8_t n, uint8_t el_count, uint8_t el_size, uint8_t idx_p1)
Definition rasm_print.c:113
static void print_base_reg(AVBPrint *bp, uint8_t n)
Definition rasm_print.c:151
int num_labels
Definition rasm.h:189
int error
Definition rasm.h:192
int num_entries
Definition rasm.h:187
RasmEntry * entries
Definition rasm.h:186
char ** labels
Definition rasm.h:188
char * text
Definition rasm.h:127
char * text
Definition rasm.h:141
bool export
Definition rasm.h:136
char * name
Definition rasm.h:135
bool jumpable
Definition rasm.h:137
RasmOp op[4]
Definition rasm.h:123
RasmNodeComment comment
Definition rasm.h:149
RasmNodeLabel label
Definition rasm.h:150
RasmNodeInsn insn
Definition rasm.h:148
RasmNodeFunc func
Definition rasm.h:151
RasmNodeDirective directive
Definition rasm.h:152
Definition swscale.c:71
#define av_freep(p)
int size
Runtime assembler for AArch64.
Definition rasm.h:44