FFmpeg
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 
41 static 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 
50 static 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 
58 static 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 
79 static 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 
100 static 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 
113 static 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 
127 static 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 
151 static 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 
159 static 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;
180  case AARCH64_BASE_POST:
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 
191 static 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 
210 static 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 
219 static void print_op_cond(AVBPrint *bp, RasmOp op)
220 {
221  av_bprintf(bp, "%s", cond_name(a64op_cond_val(op)));
222 }
223 
224 /*********************************************************************/
225 /* Instruction operands */
226 
227 static 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 
258 static 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 
320 static 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 
329 static 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];
348  if (rasm_op_type(op) == RASM_OP_NONE)
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 
359 static 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 
370 static 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 
393 static 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 
404 static 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 
414 static 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 /*********************************************************************/
422 int 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;
458  case RASM_NODE_COMMENT:
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;
464  case RASM_NODE_FUNCTION:
465  print_node_function(rctx, bp, line_start, node);
466  break;
467  case RASM_NODE_ENDFUNC:
468  print_node_endfunc(rctx, bp, line_start, node);
469  break;
470  case RASM_NODE_DIRECTIVE:
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 }
AARCH64_INSN_MOVI
@ AARCH64_INSN_MOVI
Definition: rasm.h:276
AARCH64_COND_NE
#define AARCH64_COND_NE
Definition: rasm.h:322
RasmNode::label
RasmNodeLabel label
Definition: rasm.h:150
entry
#define entry
Definition: aom_film_grain_template.c:66
print_op_imm
static void print_op_imm(AVBPrint *bp, RasmOp op)
Definition: rasm_print.c:50
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
print_op_label
static void print_op_label(const RasmContext *rctx, AVBPrint *bp, RasmOp op, const int *local_labels)
Definition: rasm_print.c:58
AARCH64_INSN_SUBS
@ AARCH64_INSN_SUBS
Definition: rasm.h:290
AARCH64_INSN_FMAX
@ AARCH64_INSN_FMAX
Definition: rasm.h:260
RASM_NODE_DIRECTIVE
@ RASM_NODE_DIRECTIVE
Definition: rasm.h:117
RasmContext::entries
RasmEntry * entries
Definition: rasm.h:186
RASM_NODE_LABEL
@ RASM_NODE_LABEL
Definition: rasm.h:114
AARCH64_INSN_STR
@ AARCH64_INSN_STR
Definition: rasm.h:288
RasmContext::error
int error
Definition: rasm.h:192
AARCH64_INSN_LDRH
@ AARCH64_INSN_LDRH
Definition: rasm.h:273
elem_type_char
static char elem_type_char(uint8_t elem_size)
Definition: rasm_print.c:100
RASM_OP_LABEL
@ RASM_OP_LABEL
Definition: rasm.h:65
mode
Definition: swscale.c:71
AARCH64_INSN_USHLL
@ AARCH64_INSN_USHLL
Definition: rasm.h:298
AARCH64_INSN_USHL
@ AARCH64_INSN_USHL
Definition: rasm.h:297
a64op_vec_idx_p1
static uint8_t a64op_vec_idx_p1(RasmOp op)
Definition: rasm.h:381
AARCH64_INSN_SUB
@ AARCH64_INSN_SUB
Definition: rasm.h:289
INSTR_INDENT
#define INSTR_INDENT
Static file backend for the runtime assembler.
Definition: rasm_print.c:38
AARCH64_INSN_FCVTZU
@ AARCH64_INSN_FCVTZU
Definition: rasm.h:259
FFMAX
#define FFMAX(a, b)
Definition: macros.h:47
RASM_NODE_INSN
@ RASM_NODE_INSN
Definition: rasm.h:112
RasmNode
Definition: rasm.h:145
AARCH64_INSN_LD3
@ AARCH64_INSN_LD3
Definition: rasm.h:268
print_op_base
static void print_op_base(AVBPrint *bp, RasmOp op)
Definition: rasm_print.c:159
AARCH64_INSN_REV32
@ AARCH64_INSN_REV32
Definition: rasm.h:281
AARCH64_INSN_FMUL
@ AARCH64_INSN_FMUL
Definition: rasm.h:263
rasm_op_type
static uint8_t rasm_op_type(RasmOp op)
Definition: rasm.h:58
AARCH64_INSN_UMAX
@ AARCH64_INSN_UMAX
Definition: rasm.h:294
a64op_vec_n
static uint8_t a64op_vec_n(RasmOp op)
Definition: rasm.h:377
AARCH64_COND_GE
#define AARCH64_COND_GE
Definition: rasm.h:333
print_node_endfunc
static void print_node_endfunc(const RasmContext *rctx, AVBPrint *bp, unsigned line_start, const RasmNode *node)
Definition: rasm_print.c:404
cond_name
static const char * cond_name(uint8_t cond)
Definition: rasm_print.c:210
AARCH64_INSN_LDP
@ AARCH64_INSN_LDP
Definition: rasm.h:270
RasmOp
Runtime assembler for AArch64.
Definition: rasm.h:44
RasmContext::labels
char ** labels
Definition: rasm.h:188
AARCH64_COND_AL
#define AARCH64_COND_AL
Definition: rasm.h:337
AARCH64_BASE_POST
#define AARCH64_BASE_POST
Definition: rasm.h:491
AARCH64_INSN_ST2
@ AARCH64_INSN_ST2
Definition: rasm.h:284
AARCH64_INSN_UXTL2
@ AARCH64_INSN_UXTL2
Definition: rasm.h:302
print_base_reg
static void print_base_reg(AVBPrint *bp, uint8_t n)
Definition: rasm_print.c:151
RasmContext::num_labels
int num_labels
Definition: rasm.h:189
RasmNode::insn
RasmNodeInsn insn
Definition: rasm.h:148
AARCH64_INSN_RET
@ AARCH64_INSN_RET
Definition: rasm.h:279
rasm_op_imm_val
static int32_t rasm_op_imm_val(RasmOp op)
Definition: rasm.h:87
AARCH64_INSN_ORR
@ AARCH64_INSN_ORR
Definition: rasm.h:278
AARCH64_COND_NV
#define AARCH64_COND_NV
Definition: rasm.h:338
AARCH64_OP_GPR
@ AARCH64_OP_GPR
Definition: rasm.h:312
AARCH64_COND_LT
#define AARCH64_COND_LT
Definition: rasm.h:334
AARCH64_INSN_UXTL
@ AARCH64_INSN_UXTL
Definition: rasm.h:301
RASM_OP_NONE
@ RASM_OP_NONE
Definition: rasm.h:63
op
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
AARCH64_INSN_STP
@ AARCH64_INSN_STP
Definition: rasm.h:287
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:42
print_op
static void print_op(const RasmContext *rctx, AVBPrint *bp, const int *local_labels, RasmOp op)
Definition: rasm_print.c:227
print_node_label
static void print_node_label(const RasmContext *rctx, AVBPrint *bp, unsigned line_start, const RasmNode *node, int *local_labels)
Definition: rasm_print.c:370
insn_names
static const char insn_names[AARCH64_INSN_NB][8]
Definition: rasm_print.c:258
AARCH64_INSN_NONE
@ AARCH64_INSN_NONE
Definition: rasm.h:245
AARCH64_COND_HI
#define AARCH64_COND_HI
Definition: rasm.h:331
RasmNodeDirective::text
char * text
Definition: rasm.h:141
RasmNodeInsn::op
RasmOp op[4]
Definition: rasm.h:123
print_node_insn
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
AARCH64_COND_LS
#define AARCH64_COND_LS
Definition: rasm.h:332
a64op_base_imm
static int16_t a64op_base_imm(RasmOp op)
Definition: rasm.h:502
print_op_cond
static void print_op_cond(AVBPrint *bp, RasmOp op)
Definition: rasm_print.c:219
RASM_NODE_ENDFUNC
@ RASM_NODE_ENDFUNC
Definition: rasm.h:116
AARCH64_COND_LE
#define AARCH64_COND_LE
Definition: rasm.h:336
RasmNode::func
RasmNodeFunc func
Definition: rasm.h:151
AARCH64_COND_PL
#define AARCH64_COND_PL
Definition: rasm.h:328
AARCH64_INSN_BR
@ AARCH64_INSN_BR
Definition: rasm.h:254
rasm.h
NULL
#define NULL
Definition: coverity.c:32
AARCH64_INSN_LD1R
@ AARCH64_INSN_LD1R
Definition: rasm.h:266
AARCH64_INSN_TBL
@ AARCH64_INSN_TBL
Definition: rasm.h:291
AARCH64_INSN_MUL
@ AARCH64_INSN_MUL
Definition: rasm.h:277
RasmNodeFunc::jumpable
bool jumpable
Definition: rasm.h:137
RasmNode::comment
RasmNodeComment comment
Definition: rasm.h:149
insn_name
static const char * insn_name(int id)
Definition: rasm_print.c:320
RASM_NODE_FUNCTION
@ RASM_NODE_FUNCTION
Definition: rasm.h:115
AARCH64_COND_HS
#define AARCH64_COND_HS
Definition: rasm.h:323
RasmEntry
Definition: rasm.h:173
error.h
AARCH64_INSN_LD1
@ AARCH64_INSN_LD1
Definition: rasm.h:265
AARCH64_COND_EQ
#define AARCH64_COND_EQ
Definition: rasm.h:321
AARCH64_INSN_AND
@ AARCH64_INSN_AND
Definition: rasm.h:250
RASM_OP_IMM
@ RASM_OP_IMM
Definition: rasm.h:64
AARCH64_INSN_ST3
@ AARCH64_INSN_ST3
Definition: rasm.h:285
AARCH64_INSN_ZIP1
@ AARCH64_INSN_ZIP1
Definition: rasm.h:304
i
#define i(width, name, range_min, range_max)
Definition: cbs_h264.c:63
AARCH64_INSN_ADDV
@ AARCH64_INSN_ADDV
Definition: rasm.h:248
a64op_base_n
static uint8_t a64op_base_n(RasmOp op)
Definition: rasm.h:503
AARCH64_INSN_UQXTN
@ AARCH64_INSN_UQXTN
Definition: rasm.h:296
RASM_NODE_COMMENT
@ RASM_NODE_COMMENT
Definition: rasm.h:113
RasmNodeFunc::name
char * name
Definition: rasm.h:135
size
int size
Definition: twinvq_data.h:10344
AARCH64_INSN_BCOND
@ AARCH64_INSN_BCOND
Definition: rasm.h:252
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)
Definition: rasm_print.c:113
AARCH64_INSN_SHL
@ AARCH64_INSN_SHL
Definition: rasm.h:282
AARCH64_INSN_FMIN
@ AARCH64_INSN_FMIN
Definition: rasm.h:261
av_malloc
#define av_malloc(s)
Definition: ops_static.c:44
RasmNodeLabel::id
int id
Definition: rasm.h:131
rasm_print
int rasm_print(RasmContext *rctx, AVBPrint *bp)
Definition: rasm_print.c:422
AARCH64_INSN_FMLA
@ AARCH64_INSN_FMLA
Definition: rasm.h:262
print_node_directive
static void print_node_directive(const RasmContext *rctx, AVBPrint *bp, unsigned line_start, const RasmNode *node)
Definition: rasm_print.c:414
AARCH64_INSN_CMP
@ AARCH64_INSN_CMP
Definition: rasm.h:255
AARCH64_INSN_XTN
@ AARCH64_INSN_XTN
Definition: rasm.h:303
AARCH64_INSN_ADD
@ AARCH64_INSN_ADD
Definition: rasm.h:247
a64op_vec_num_regs
static uint8_t a64op_vec_num_regs(RasmOp op)
Definition: rasm.h:380
print_op_gpr
static void print_op_gpr(AVBPrint *bp, RasmOp op)
Definition: rasm_print.c:79
bprint.h
a64op_vec_el_count
static uint8_t a64op_vec_el_count(RasmOp op)
Definition: rasm.h:378
AARCH64_INSN_NB
@ AARCH64_INSN_NB
Definition: rasm.h:307
RasmContext
Definition: rasm.h:185
AARCH64_INSN_DUP
@ AARCH64_INSN_DUP
Definition: rasm.h:257
AARCH64_INSN_USHLL2
@ AARCH64_INSN_USHLL2
Definition: rasm.h:299
AARCH64_BASE_PRE
#define AARCH64_BASE_PRE
Definition: rasm.h:490
AARCH64_COND_GT
#define AARCH64_COND_GT
Definition: rasm.h:335
AARCH64_INSN_UBFIZ
@ AARCH64_INSN_UBFIZ
Definition: rasm.h:292
a64op_gpr_size
static uint8_t a64op_gpr_size(RasmOp op)
Definition: rasm.h:352
AARCH64_COND_LO
#define AARCH64_COND_LO
Definition: rasm.h:325
AARCH64_INSN_ZIP2
@ AARCH64_INSN_ZIP2
Definition: rasm.h:305
RasmContext::num_entries
int num_entries
Definition: rasm.h:187
AARCH64_INSN_LD2
@ AARCH64_INSN_LD2
Definition: rasm.h:267
RasmNodeInsn::id
int id
Definition: rasm.h:122
AARCH64_INSN_ST1
@ AARCH64_INSN_ST1
Definition: rasm.h:283
print_node_function
static void print_node_function(const RasmContext *rctx, AVBPrint *bp, unsigned line_start, const RasmNode *node)
Definition: rasm_print.c:393
AARCH64_INSN_CSEL
@ AARCH64_INSN_CSEL
Definition: rasm.h:256
a64op_cond_val
static uint8_t a64op_cond_val(RasmOp op)
Definition: rasm.h:521
a64op_base_mode
static uint8_t a64op_base_mode(RasmOp op)
Definition: rasm.h:504
AARCH64_INSN_INS
@ AARCH64_INSN_INS
Definition: rasm.h:264
a64op_vec_el_size
static uint8_t a64op_vec_el_size(RasmOp op)
Definition: rasm.h:379
RasmNodeComment::text
char * text
Definition: rasm.h:127
AARCH64_OP_BASE
@ AARCH64_OP_BASE
Definition: rasm.h:314
av_bprintf
void av_bprintf(AVBPrint *buf, const char *fmt,...)
Definition: bprint.c:122
print_node_comment
static void print_node_comment(const RasmContext *rctx, AVBPrint *bp, unsigned line_start, const RasmNode *node)
Definition: rasm_print.c:359
AARCH64_OP_VEC
@ AARCH64_OP_VEC
Definition: rasm.h:313
id
enum AVCodecID id
Definition: dts2pts.c:607
AARCH64_INSN_BLR
@ AARCH64_INSN_BLR
Definition: rasm.h:253
cond_names
static const char cond_names[16][4]
Definition: rasm_print.c:191
AARCH64_INSN_B
@ AARCH64_INSN_B
Definition: rasm.h:251
AARCH64_COND_VS
#define AARCH64_COND_VS
Definition: rasm.h:329
AARCH64_COND_MI
#define AARCH64_COND_MI
Definition: rasm.h:327
RasmNode::directive
RasmNodeDirective directive
Definition: rasm.h:152
AARCH64_INSN_FADD
@ AARCH64_INSN_FADD
Definition: rasm.h:258
AARCH64_INSN_ADR
@ AARCH64_INSN_ADR
Definition: rasm.h:249
AARCH64_OP_COND
@ AARCH64_OP_COND
Definition: rasm.h:315
RasmNodeFunc::export
bool export
Definition: rasm.h:136
AARCH64_INSN_UCVTF
@ AARCH64_INSN_UCVTF
Definition: rasm.h:293
mem.h
AARCH64_INSN_LSR
@ AARCH64_INSN_LSR
Definition: rasm.h:274
AARCH64_INSN_USHR
@ AARCH64_INSN_USHR
Definition: rasm.h:300
AARCH64_INSN_MOV
@ AARCH64_INSN_MOV
Definition: rasm.h:275
print_op_vec
static void print_op_vec(AVBPrint *bp, RasmOp op)
Definition: rasm_print.c:127
AARCH64_INSN_ST4
@ AARCH64_INSN_ST4
Definition: rasm.h:286
AARCH64_INSN_REV16
@ AARCH64_INSN_REV16
Definition: rasm.h:280
AARCH64_BASE_OFFSET
#define AARCH64_BASE_OFFSET
Definition: rasm.h:489
AARCH64_INSN_LDRB
@ AARCH64_INSN_LDRB
Definition: rasm.h:272
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:35
rasm_op_label_id
static int rasm_op_label_id(RasmOp op)
Definition: rasm.h:103
COMMENT_COL
#define COMMENT_COL
Definition: rasm_print.c:39
AARCH64_INSN_UMIN
@ AARCH64_INSN_UMIN
Definition: rasm.h:295
AARCH64_INSN_LDR
@ AARCH64_INSN_LDR
Definition: rasm.h:271
AARCH64_COND_VC
#define AARCH64_COND_VC
Definition: rasm.h:330
indent_to
static void indent_to(AVBPrint *bp, unsigned line_start, int col)
Definition: rasm_print.c:41
cond
int(* cond)(enum AVPixelFormat pix_fmt)
Definition: pixdesc_query.c:28
AARCH64_INSN_LD4
@ AARCH64_INSN_LD4
Definition: rasm.h:269
a64op_gpr_n
static uint8_t a64op_gpr_n(RasmOp op)
Definition: rasm.h:351