FFmpeg
rasm.h
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 #ifndef SWSCALE_AARCH64_RASM_H
22 #define SWSCALE_AARCH64_RASM_H
23 
24 #include <stdbool.h>
25 #include <stddef.h>
26 #include <stdint.h>
27 #include <stdio.h>
28 
29 #include "libavutil/attributes.h"
30 #include "libavutil/avassert.h"
31 
32 /**
33  * Runtime assembler for AArch64. Provides an instruction-level IR and
34  * builder API tailored to the needs of the swscale dynamic pipeline.
35  * NOTE: Currently only a static file backend, which emits GNU assembler
36  * text, has been implemented.
37  */
38 
39 /*********************************************************************/
40 /* Instruction operands */
41 
42 /* A packed 64-bit value representing a single instruction operand. */
43 typedef union RasmOp {
44  uint8_t u8 [8];
45  uint16_t u16[4];
46  uint32_t u32[2];
47  uint64_t u64;
48 } RasmOp;
49 
50 static inline RasmOp rasm_op_new(int type)
51 {
52  RasmOp op = { 0 };
53  op.u8[7] = type;
54  return op;
55 }
56 
57 static inline uint8_t rasm_op_type(RasmOp op) { return op.u8[7]; }
58 
59 /* Generic operand types */
60 
61 typedef enum RasmOpType {
66 } RasmOpType;
67 
68 /* RASM_OP_NONE */
69 
70 static inline RasmOp rasm_op_none(void)
71 {
72  return rasm_op_new(RASM_OP_NONE);
73 }
74 
75 #define OPN rasm_op_none()
76 
77 /* RASM_OP_IMM */
78 
79 static inline RasmOp rasm_op_imm(int32_t val)
80 {
82  op.u32[0] = (uint32_t) val;
83  return op;
84 }
85 
87 {
88  return (int32_t) op.u32[0];
89 }
90 
91 #define IMM(val) rasm_op_imm(val)
92 
93 /* RASM_OP_LABEL */
94 
95 static inline RasmOp rasm_op_label(int id)
96 {
98  op.u16[0] = (uint16_t) id;
99  return op;
100 }
101 
102 static inline int rasm_op_label_id(RasmOp op)
103 {
104  return (int) op.u16[0];
105 }
106 
107 /*********************************************************************/
108 /* IR Nodes */
109 
110 typedef enum RasmNodeType {
117  RASM_NODE_DATA, /* NOTE not yet implemented */
118 } RasmNodeType;
119 
120 typedef struct RasmNodeInsn {
121  int id;
122  RasmOp op[4];
123 } RasmNodeInsn;
124 
125 typedef struct RasmNodeComment {
126  char *text;
128 
129 typedef struct RasmNodeLabel {
130  int id;
131 } RasmNodeLabel;
132 
133 typedef struct RasmNodeFunc {
134  char *name;
135  bool export;
136  bool jumpable;
137 } RasmNodeFunc;
138 
139 typedef struct RasmNodeDirective {
140  char *text;
142 
143 /* A single node in the IR. */
144 typedef struct RasmNode {
146  union {
152  };
154  struct RasmNode *prev;
155  struct RasmNode *next;
156 } RasmNode;
157 
158 /*********************************************************************/
159 /* Top-level IR entries */
160 
161 typedef enum RasmEntryType {
163  RASM_ENTRY_DATA, /* NOTE not yet implemented */
164 } RasmEntryType;
165 
166 typedef struct RasmFunction {
167  bool export;
168  int label_id;
169 } RasmFunction;
170 
171 /* A contiguous range of nodes. */
172 typedef struct RasmEntry {
176  union {
178  };
179 } RasmEntry;
180 
181 /*********************************************************************/
182 /* Main runtime assembler context */
183 
184 typedef struct RasmContext {
187  char **labels;
191  int error;
192 } RasmContext;
193 
194 RasmContext *rasm_alloc(void);
195 void rasm_free(RasmContext **prctx);
196 
197 /* IR Nodes */
198 RasmNode *rasm_add_insn(RasmContext *rctx, int id,
199  RasmOp op0, RasmOp op1, RasmOp op2, RasmOp op3);
200 RasmNode *rasm_add_comment(RasmContext *rctx, const char *comment);
201 RasmNode *rasm_add_commentf(RasmContext *rctx, char *s, size_t n,
202  const char *fmt, ...) av_printf_format(4, 5);
203 RasmNode *rasm_add_label(RasmContext *rctx, int id);
204 RasmNode *rasm_add_func(RasmContext *rctx, int id, bool export,
205  bool jumpable);
207 RasmNode *rasm_add_directive(RasmContext *rctx, const char *text);
208 
211 
212 /* Top-level IR entries */
213 int rasm_func_begin(RasmContext *rctx, const char *name, bool export,
214  bool jumpable);
215 
216 /**
217  * Allocate a new label ID with the given name.
218  *
219  * @param name label name or NULL for local label
220  * @return new label ID, negative error code on failure
221  */
222 int rasm_new_label(RasmContext *rctx, const char *name);
223 int rasm_new_labelf(RasmContext *rctx, char *s, size_t n,
224  const char *fmt, ...) av_printf_format(4, 5);
225 
226 /* Annotate current instruction node in the IR. */
227 void rasm_annotate(RasmContext *rctx, const char *comment);
228 void rasm_annotatef(RasmContext *rctx, char *s, size_t n,
229  const char *fmt, ...) av_printf_format(4, 5);
230 
231 /* Annotate next instruction node added to the IR. */
232 void rasm_annotate_next(RasmContext *rctx, const char *comment);
233 void rasm_annotate_nextf(RasmContext *rctx, char *s, size_t n,
234  const char *fmt, ...) av_printf_format(4, 5);
235 
236 /* Emit the assembled IR as GNU assembler text to fp. */
237 int rasm_print(RasmContext *rctx, FILE *fp);
238 
239 /*********************************************************************/
240 /* AArch64-specific */
241 
242 /* Supported AArch64 instructions */
243 typedef enum AArch64InsnId {
245 
303 
305 } AArch64InsnId;
306 
307 /* Supported AArch64 operand types */
308 typedef enum AArch64OpType {
313 
315 } AArch64OpType;
316 
317 /* AArch64 condition codes */
318 #define AARCH64_COND_EQ 0x0
319 #define AARCH64_COND_NE 0x1
320 #define AARCH64_COND_HS 0x2
321 #define AARCH64_COND_CS AARCH64_COND_HS
322 #define AARCH64_COND_LO 0x3
323 #define AARCH64_COND_CC AARCH64_COND_LO
324 #define AARCH64_COND_MI 0x4
325 #define AARCH64_COND_PL 0x5
326 #define AARCH64_COND_VS 0x6
327 #define AARCH64_COND_VC 0x7
328 #define AARCH64_COND_HI 0x8
329 #define AARCH64_COND_LS 0x9
330 #define AARCH64_COND_GE 0xa
331 #define AARCH64_COND_LT 0xb
332 #define AARCH64_COND_GT 0xc
333 #define AARCH64_COND_LE 0xd
334 #define AARCH64_COND_AL 0xe
335 #define AARCH64_COND_NV 0xf
336 
337 /*********************************************************************/
338 /* AARCH64_OP_GPR */
339 
340 static inline RasmOp a64op_make_gpr(uint8_t n, uint8_t size)
341 {
343  op.u8[0] = n;
344  op.u8[1] = size;
345  return op;
346 }
347 
348 static inline uint8_t a64op_gpr_n (RasmOp op) { return op.u8[0]; }
349 static inline uint8_t a64op_gpr_size(RasmOp op) { return op.u8[1]; }
350 
351 static inline RasmOp a64op_gpw(uint8_t n) { return a64op_make_gpr(n, sizeof(uint32_t)); }
352 static inline RasmOp a64op_gpx(uint8_t n) { return a64op_make_gpr(n, sizeof(uint64_t)); }
353 static inline RasmOp a64op_sp (void) { return a64op_make_gpr(31, sizeof(uint64_t)); }
354 
355 /* modifiers */
356 static inline RasmOp a64op_w(RasmOp op) { return a64op_gpw(a64op_gpr_n(op)); }
357 static inline RasmOp a64op_x(RasmOp op) { return a64op_gpx(a64op_gpr_n(op)); }
358 
359 /*********************************************************************/
360 /* AARCH64_OP_VEC */
361 
362 static inline RasmOp a64op_make_vec(uint8_t n, uint8_t el_count, uint8_t el_size)
363 {
365  op.u8[0] = n;
366  op.u8[1] = el_count;
367  op.u8[2] = el_size;
368  op.u8[3] = 0; /* num_regs */
369  op.u8[4] = 0; /* idx_p1 */
370  return op;
371 }
372 
373 static inline uint8_t a64op_vec_n (RasmOp op) { return op.u8[0]; }
374 static inline uint8_t a64op_vec_el_count(RasmOp op) { return op.u8[1]; }
375 static inline uint8_t a64op_vec_el_size (RasmOp op) { return op.u8[2]; }
376 static inline uint8_t a64op_vec_num_regs(RasmOp op) { return op.u8[3]; }
377 static inline uint8_t a64op_vec_idx_p1 (RasmOp op) { return op.u8[4]; }
378 
379 static inline RasmOp a64op_vec (uint8_t n) { return a64op_make_vec(n, 0, 0); }
380 static inline RasmOp a64op_vecb (uint8_t n) { return a64op_make_vec(n, 0, 1); }
381 static inline RasmOp a64op_vech (uint8_t n) { return a64op_make_vec(n, 0, 2); }
382 static inline RasmOp a64op_vecs (uint8_t n) { return a64op_make_vec(n, 0, 4); }
383 static inline RasmOp a64op_vecd (uint8_t n) { return a64op_make_vec(n, 0, 8); }
384 static inline RasmOp a64op_vecq (uint8_t n) { return a64op_make_vec(n, 0, 16); }
385 static inline RasmOp a64op_vec8b (uint8_t n) { return a64op_make_vec(n, 8, 1); }
386 static inline RasmOp a64op_vec16b(uint8_t n) { return a64op_make_vec(n, 16, 1); }
387 static inline RasmOp a64op_vec4h (uint8_t n) { return a64op_make_vec(n, 4, 2); }
388 static inline RasmOp a64op_vec8h (uint8_t n) { return a64op_make_vec(n, 8, 2); }
389 static inline RasmOp a64op_vec2s (uint8_t n) { return a64op_make_vec(n, 2, 4); }
390 static inline RasmOp a64op_vec4s (uint8_t n) { return a64op_make_vec(n, 4, 4); }
391 static inline RasmOp a64op_vec2d (uint8_t n) { return a64op_make_vec(n, 2, 8); }
392 
393 /**
394  * Create register-list operand for structured load/store instructions.
395  * Registers must be consecutive.
396  */
397 static inline RasmOp a64op_veclist(RasmOp op0, RasmOp op1, RasmOp op2, RasmOp op3)
398 {
400  uint8_t num_regs = 1;
401  if (rasm_op_type(op1) != RASM_OP_NONE) {
402  av_assert0(((a64op_vec_n(op0) + 1) & 0x1f) == a64op_vec_n(op1));
403  num_regs++;
404  if (rasm_op_type(op2) != RASM_OP_NONE) {
405  av_assert0(((a64op_vec_n(op1) + 1) & 0x1f) == a64op_vec_n(op2));
406  num_regs++;
407  if (rasm_op_type(op3) != RASM_OP_NONE) {
408  av_assert0(((a64op_vec_n(op2) + 1) & 0x1f) == a64op_vec_n(op3));
409  num_regs++;
410  }
411  }
412  }
413  op0.u8[3] = num_regs;
414  return op0;
415 }
416 
417 /* by-element modifier */
418 static inline RasmOp a64op_elem(RasmOp op, uint8_t idx)
419 {
420  op.u8[1] = 0; /* el_count */
421  op.u8[4] = idx + 1;
422  return op;
423 }
424 
425 /* scalar modifiers */
426 static inline RasmOp v_b(RasmOp op) { return a64op_vecb(a64op_vec_n(op)); }
427 static inline RasmOp v_h(RasmOp op) { return a64op_vech(a64op_vec_n(op)); }
428 static inline RasmOp v_s(RasmOp op) { return a64op_vecs(a64op_vec_n(op)); }
429 static inline RasmOp v_d(RasmOp op) { return a64op_vecd(a64op_vec_n(op)); }
430 static inline RasmOp v_q(RasmOp op) { return a64op_vecq(a64op_vec_n(op)); }
431 
432 /* arrangement specifier modifiers */
433 static inline RasmOp v_8b (RasmOp op) { return a64op_vec8b (a64op_vec_n(op)); }
434 static inline RasmOp v_16b(RasmOp op) { return a64op_vec16b(a64op_vec_n(op)); }
435 static inline RasmOp v_4h (RasmOp op) { return a64op_vec4h (a64op_vec_n(op)); }
436 static inline RasmOp v_8h (RasmOp op) { return a64op_vec8h (a64op_vec_n(op)); }
437 static inline RasmOp v_2s (RasmOp op) { return a64op_vec2s (a64op_vec_n(op)); }
438 static inline RasmOp v_4s (RasmOp op) { return a64op_vec4s (a64op_vec_n(op)); }
439 static inline RasmOp v_2d (RasmOp op) { return a64op_vec2d (a64op_vec_n(op)); }
440 
441 /* register-list modifiers */
442 static inline RasmOp vv_1(RasmOp op0) { return a64op_veclist(op0, OPN, OPN, OPN); }
443 static inline RasmOp vv_2(RasmOp op0, RasmOp op1) { return a64op_veclist(op0, op1, OPN, OPN); }
444 static inline RasmOp vv_3(RasmOp op0, RasmOp op1, RasmOp op2) { return a64op_veclist(op0, op1, op2, OPN); }
445 static inline RasmOp vv_4(RasmOp op0, RasmOp op1, RasmOp op2, RasmOp op3) { return a64op_veclist(op0, op1, op2, op3); }
446 
447 /**
448  * This helper structure is used to mimic the assembler syntax for vector
449  * register modifiers. This simplifies writing code with expressions such
450  * as vtmp.s and vtmp.b16 instead of v_s(vtmp) and v_16b(vtmp).
451  */
452 typedef struct AArch64VecViews {
453  /* scalar */
459  /* arrangement specifier */
467  /* by element */
468  RasmOp be[2]; /* NOTE it should be 16 but we only use 2 so far. */
469  RasmOp de[2];
471 
472 /* Fill vector view struct for given op. */
474 
475 /*********************************************************************/
476 /* AARCH64_OP_BASE */
477 
478 #define AARCH64_BASE_OFFSET 0
479 #define AARCH64_BASE_PRE 1
480 #define AARCH64_BASE_POST 2
481 
482 static inline RasmOp a64op_make_base(uint8_t n, uint8_t mode, int16_t imm)
483 {
485  op.u16[0] = (uint16_t) imm;
486  op.u8[2] = n;
487  op.u8[3] = mode;
488  return op;
489 }
490 
491 static inline int16_t a64op_base_imm (RasmOp op) { return (int16_t) op.u16[0]; }
492 static inline uint8_t a64op_base_n (RasmOp op) { return op.u8[2]; }
493 static inline uint8_t a64op_base_mode(RasmOp op) { return op.u8[3]; }
494 
496 static inline RasmOp a64op_off (RasmOp op, int16_t imm) { return a64op_make_base(a64op_gpr_n(op), AARCH64_BASE_OFFSET, imm); }
497 static inline RasmOp a64op_pre (RasmOp op, int16_t imm) { return a64op_make_base(a64op_gpr_n(op), AARCH64_BASE_PRE, imm); }
498 static inline RasmOp a64op_post(RasmOp op, int16_t imm) { return a64op_make_base(a64op_gpr_n(op), AARCH64_BASE_POST, imm); }
499 
500 /*********************************************************************/
501 /* AARCH64_OP_COND */
502 
503 static inline RasmOp a64op_cond(int cond)
504 {
506  op.u8[0] = cond;
507  return op;
508 }
509 
510 static inline uint8_t a64op_cond_val(RasmOp op) { return op.u8[0]; }
511 
512 static inline RasmOp a64cond_eq(void) { return a64op_cond(AARCH64_COND_EQ); }
513 static inline RasmOp a64cond_ne(void) { return a64op_cond(AARCH64_COND_NE); }
514 static inline RasmOp a64cond_hs(void) { return a64op_cond(AARCH64_COND_HS); }
515 static inline RasmOp a64cond_cs(void) { return a64op_cond(AARCH64_COND_CS); }
516 static inline RasmOp a64cond_lo(void) { return a64op_cond(AARCH64_COND_LO); }
517 static inline RasmOp a64cond_cc(void) { return a64op_cond(AARCH64_COND_CC); }
518 static inline RasmOp a64cond_mi(void) { return a64op_cond(AARCH64_COND_MI); }
519 static inline RasmOp a64cond_pl(void) { return a64op_cond(AARCH64_COND_PL); }
520 static inline RasmOp a64cond_vs(void) { return a64op_cond(AARCH64_COND_VS); }
521 static inline RasmOp a64cond_vc(void) { return a64op_cond(AARCH64_COND_VC); }
522 static inline RasmOp a64cond_hi(void) { return a64op_cond(AARCH64_COND_HI); }
523 static inline RasmOp a64cond_ls(void) { return a64op_cond(AARCH64_COND_LS); }
524 static inline RasmOp a64cond_ge(void) { return a64op_cond(AARCH64_COND_GE); }
525 static inline RasmOp a64cond_lt(void) { return a64op_cond(AARCH64_COND_LT); }
526 static inline RasmOp a64cond_gt(void) { return a64op_cond(AARCH64_COND_GT); }
527 static inline RasmOp a64cond_le(void) { return a64op_cond(AARCH64_COND_LE); }
528 static inline RasmOp a64cond_al(void) { return a64op_cond(AARCH64_COND_AL); }
529 static inline RasmOp a64cond_nv(void) { return a64op_cond(AARCH64_COND_NV); }
530 
531 /*********************************************************************/
532 /* Helpers to add instructions. */
533 
534 #define i_none(rctx ) rasm_add_insn(rctx, AARCH64_INSN_NONE, OPN, OPN, OPN, OPN)
535 
536 #define i_add(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_ADD, op0, op1, op2, OPN)
537 #define i_addv(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_ADDV, op0, op1, OPN, OPN)
538 #define i_adr(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_ADR, op0, op1, OPN, OPN)
539 #define i_and(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_AND, op0, op1, op2, OPN)
540 #define i_b(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_B, op0, op1, OPN, OPN)
541 #define i_br(rctx, op0 ) rasm_add_insn(rctx, AARCH64_INSN_BR, op0, OPN, OPN, OPN)
542 #define i_cmp(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_CMP, op0, op1, OPN, OPN)
543 #define i_csel(rctx, op0, op1, op2, op3) rasm_add_insn(rctx, AARCH64_INSN_CSEL, op0, op1, op2, op3)
544 #define i_dup(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_DUP, op0, op1, OPN, OPN)
545 #define i_fadd(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_FADD, op0, op1, op2, OPN)
546 #define i_fcvtzu(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_FCVTZU, op0, op1, OPN, OPN)
547 #define i_fmax(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_FMAX, op0, op1, op2, OPN)
548 #define i_fmin(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_FMIN, op0, op1, op2, OPN)
549 #define i_fmla(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_FMLA, op0, op1, op2, OPN)
550 #define i_fmul(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_FMUL, op0, op1, op2, OPN)
551 #define i_ins(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_INS, op0, op1, OPN, OPN)
552 #define i_ld1(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_LD1, op0, op1, OPN, OPN)
553 #define i_ld1r(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_LD1R, op0, op1, OPN, OPN)
554 #define i_ld2(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_LD2, op0, op1, OPN, OPN)
555 #define i_ld3(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_LD3, op0, op1, OPN, OPN)
556 #define i_ld4(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_LD4, op0, op1, OPN, OPN)
557 #define i_ldp(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_LDP, op0, op1, op2, OPN)
558 #define i_ldr(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_LDR, op0, op1, OPN, OPN)
559 #define i_ldrb(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_LDRB, op0, op1, OPN, OPN)
560 #define i_ldrh(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_LDRH, op0, op1, OPN, OPN)
561 #define i_lsr(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_LSR, op0, op1, op2, OPN)
562 #define i_mov(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_MOV, op0, op1, OPN, OPN)
563 #define i_movi(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_MOVI, op0, op1, OPN, OPN)
564 #define i_mul(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_MUL, op0, op1, op2, OPN)
565 #define i_orr(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_ORR, op0, op1, op2, OPN)
566 #define i_ret(rctx ) rasm_add_insn(rctx, AARCH64_INSN_RET, OPN, OPN, OPN, OPN)
567 #define i_rev16(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_REV16, op0, op1, OPN, OPN)
568 #define i_rev32(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_REV32, op0, op1, OPN, OPN)
569 #define i_shl(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_SHL, op0, op1, op2, OPN)
570 #define i_st1(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_ST1, op0, op1, OPN, OPN)
571 #define i_st2(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_ST2, op0, op1, OPN, OPN)
572 #define i_st3(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_ST3, op0, op1, OPN, OPN)
573 #define i_st4(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_ST4, op0, op1, OPN, OPN)
574 #define i_stp(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_STP, op0, op1, op2, OPN)
575 #define i_str(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_STR, op0, op1, OPN, OPN)
576 #define i_sub(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_SUB, op0, op1, op2, OPN)
577 #define i_subs(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_SUBS, op0, op1, op2, OPN)
578 #define i_tbl(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_TBL, op0, op1, op2, OPN)
579 #define i_ubfiz(rctx, op0, op1, op2, op3) rasm_add_insn(rctx, AARCH64_INSN_UBFIZ, op0, op1, op2, op3)
580 #define i_ucvtf(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_UCVTF, op0, op1, OPN, OPN)
581 #define i_umax(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_UMAX, op0, op1, op2, OPN)
582 #define i_umin(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_UMIN, op0, op1, op2, OPN)
583 #define i_uqxtn(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_UQXTN, op0, op1, OPN, OPN)
584 #define i_ushl(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_USHL, op0, op1, op2, OPN)
585 #define i_ushll(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_USHLL, op0, op1, op2, OPN)
586 #define i_ushll2(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_USHLL2, op0, op1, op2, OPN)
587 #define i_ushr(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_USHR, op0, op1, op2, OPN)
588 #define i_uxtl(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_UXTL, op0, op1, OPN, OPN)
589 #define i_uxtl2(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_UXTL2, op0, op1, OPN, OPN)
590 #define i_xtn(rctx, op0, op1 ) rasm_add_insn(rctx, AARCH64_INSN_XTN, op0, op1, OPN, OPN)
591 #define i_zip1(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_ZIP1, op0, op1, op2, OPN)
592 #define i_zip2(rctx, op0, op1, op2 ) rasm_add_insn(rctx, AARCH64_INSN_ZIP2, op0, op1, op2, OPN)
593 
594 /* Branch helpers. */
595 #define i_beq(rctx, id) i_b(rctx, a64cond_eq(), rasm_op_label(id))
596 #define i_bne(rctx, id) i_b(rctx, a64cond_ne(), rasm_op_label(id))
597 #define i_bhs(rctx, id) i_b(rctx, a64cond_hs(), rasm_op_label(id))
598 #define i_bcs(rctx, id) i_b(rctx, a64cond_cs(), rasm_op_label(id))
599 #define i_blo(rctx, id) i_b(rctx, a64cond_lo(), rasm_op_label(id))
600 #define i_bcc(rctx, id) i_b(rctx, a64cond_cc(), rasm_op_label(id))
601 #define i_bmi(rctx, id) i_b(rctx, a64cond_mi(), rasm_op_label(id))
602 #define i_bpl(rctx, id) i_b(rctx, a64cond_pl(), rasm_op_label(id))
603 #define i_bvs(rctx, id) i_b(rctx, a64cond_vs(), rasm_op_label(id))
604 #define i_bvc(rctx, id) i_b(rctx, a64cond_vc(), rasm_op_label(id))
605 #define i_bhi(rctx, id) i_b(rctx, a64cond_hi(), rasm_op_label(id))
606 #define i_bls(rctx, id) i_b(rctx, a64cond_ls(), rasm_op_label(id))
607 #define i_bge(rctx, id) i_b(rctx, a64cond_ge(), rasm_op_label(id))
608 #define i_blt(rctx, id) i_b(rctx, a64cond_lt(), rasm_op_label(id))
609 #define i_bgt(rctx, id) i_b(rctx, a64cond_gt(), rasm_op_label(id))
610 #define i_ble(rctx, id) i_b(rctx, a64cond_le(), rasm_op_label(id))
611 
612 /* Extra helpers. */
613 #define i_mov16b(rctx, op0, op1) i_mov(rctx, v_16b(op0), v_16b(op1))
614 
615 #endif /* SWSCALE_AARCH64_RASM_H */
AARCH64_INSN_MOVI
@ AARCH64_INSN_MOVI
Definition: rasm.h:273
a64cond_eq
static RasmOp a64cond_eq(void)
Definition: rasm.h:512
AArch64VecViews::h8
RasmOp h8
Definition: rasm.h:463
AARCH64_COND_NE
#define AARCH64_COND_NE
Definition: rasm.h:319
name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
RasmNode::label
RasmNodeLabel label
Definition: rasm.h:149
rasm_annotate_next
void void rasm_annotate_next(RasmContext *rctx, const char *comment)
Definition: rasm.c:263
RasmOpType
RasmOpType
Definition: rasm.h:61
v_h
static RasmOp v_h(RasmOp op)
Definition: rasm.h:427
AARCH64_INSN_SUBS
@ AARCH64_INSN_SUBS
Definition: rasm.h:287
out
static FILE * out
Definition: movenc.c:55
a64op_vecd
static RasmOp a64op_vecd(uint8_t n)
Definition: rasm.h:383
a64op_base
static RasmOp a64op_base(RasmOp op)
Definition: rasm.h:495
AArch64VecViews::b16
RasmOp b16
Definition: rasm.h:461
AArch64VecViews::d
RasmOp d
Definition: rasm.h:457
AARCH64_INSN_FMAX
@ AARCH64_INSN_FMAX
Definition: rasm.h:257
a64op_vecq
static RasmOp a64op_vecq(uint8_t n)
Definition: rasm.h:384
RASM_NODE_DIRECTIVE
@ RASM_NODE_DIRECTIVE
Definition: rasm.h:116
RasmContext::entries
RasmEntry * entries
Definition: rasm.h:185
RASM_NODE_LABEL
@ RASM_NODE_LABEL
Definition: rasm.h:113
OPN
#define OPN
Definition: rasm.h:75
AARCH64_INSN_STR
@ AARCH64_INSN_STR
Definition: rasm.h:285
AArch64VecViews::s2
RasmOp s2
Definition: rasm.h:464
a64cond_cc
static RasmOp a64cond_cc(void)
Definition: rasm.h:517
a64op_gpx
static RasmOp a64op_gpx(uint8_t n)
Definition: rasm.h:352
a64op_w
static RasmOp a64op_w(RasmOp op)
Definition: rasm.h:356
RasmContext::error
int error
Definition: rasm.h:191
a64cond_cs
static RasmOp a64cond_cs(void)
Definition: rasm.h:515
rasm_add_label
RasmNode RasmNode * rasm_add_label(RasmContext *rctx, int id)
Definition: rasm.c:146
AARCH64_INSN_LDRH
@ AARCH64_INSN_LDRH
Definition: rasm.h:270
a64cond_ne
static RasmOp a64cond_ne(void)
Definition: rasm.h:513
rasm_add_insn
RasmNode * rasm_add_insn(RasmContext *rctx, int id, RasmOp op0, RasmOp op1, RasmOp op2, RasmOp op3)
Definition: rasm.c:101
RASM_OP_LABEL
@ RASM_OP_LABEL
Definition: rasm.h:64
mode
Definition: swscale.c:59
RASM_OP_NB
@ RASM_OP_NB
Definition: rasm.h:65
a64cond_le
static RasmOp a64cond_le(void)
Definition: rasm.h:527
AARCH64_INSN_USHLL
@ AARCH64_INSN_USHLL
Definition: rasm.h:295
AArch64VecViews
This helper structure is used to mimic the assembler syntax for vector register modifiers.
Definition: rasm.h:452
a64op_gpw
static RasmOp a64op_gpw(uint8_t n)
Definition: rasm.h:351
vv_2
static RasmOp vv_2(RasmOp op0, RasmOp op1)
Definition: rasm.h:443
AARCH64_INSN_USHL
@ AARCH64_INSN_USHL
Definition: rasm.h:294
AARCH64_COND_CS
#define AARCH64_COND_CS
Definition: rasm.h:321
vv_3
static RasmOp vv_3(RasmOp op0, RasmOp op1, RasmOp op2)
Definition: rasm.h:444
AArch64InsnId
AArch64InsnId
Definition: rasm.h:243
RASM_NODE_DATA
@ RASM_NODE_DATA
Definition: rasm.h:117
rasm_add_func
RasmNode * rasm_add_func(RasmContext *rctx, int id, bool export, bool jumpable)
Definition: rasm.c:155
a64cond_lt
static RasmOp a64cond_lt(void)
Definition: rasm.h:525
a64op_vec_idx_p1
static uint8_t a64op_vec_idx_p1(RasmOp op)
Definition: rasm.h:377
AARCH64_INSN_SUB
@ AARCH64_INSN_SUB
Definition: rasm.h:286
rasm_print
void int rasm_print(RasmContext *rctx, FILE *fp)
Definition: rasm_print.c:430
AARCH64_INSN_FCVTZU
@ AARCH64_INSN_FCVTZU
Definition: rasm.h:256
rasm_get_current_node
RasmNode * rasm_get_current_node(RasmContext *rctx)
Definition: rasm.c:194
RASM_NODE_INSN
@ RASM_NODE_INSN
Definition: rasm.h:111
RasmNode::prev
struct RasmNode * prev
Definition: rasm.h:154
RasmNode
Definition: rasm.h:144
AARCH64_INSN_LD3
@ AARCH64_INSN_LD3
Definition: rasm.h:265
RasmNodeInsn
Definition: rasm.h:120
rasm_op_new
static RasmOp rasm_op_new(int type)
Definition: rasm.h:50
AARCH64_INSN_REV32
@ AARCH64_INSN_REV32
Definition: rasm.h:278
RasmEntry::func
RasmFunction func
Definition: rasm.h:177
AARCH64_INSN_FMUL
@ AARCH64_INSN_FMUL
Definition: rasm.h:260
rasm_op_type
static uint8_t rasm_op_type(RasmOp op)
Definition: rasm.h:57
rasm_annotatef
void rasm_annotatef(RasmContext *rctx, char *s, size_t n, const char *fmt,...) av_printf_format(4
AARCH64_INSN_UMAX
@ AARCH64_INSN_UMAX
Definition: rasm.h:291
a64op_vec_n
static uint8_t a64op_vec_n(RasmOp op)
Definition: rasm.h:373
AARCH64_COND_GE
#define AARCH64_COND_GE
Definition: rasm.h:330
RasmEntry::end
RasmNode * end
Definition: rasm.h:175
AArch64VecViews::s
RasmOp s
Definition: rasm.h:456
AARCH64_INSN_LDP
@ AARCH64_INSN_LDP
Definition: rasm.h:267
RasmOp
Runtime assembler for AArch64.
Definition: rasm.h:43
RasmContext::labels
char ** labels
Definition: rasm.h:187
AARCH64_COND_AL
#define AARCH64_COND_AL
Definition: rasm.h:334
AARCH64_BASE_POST
#define AARCH64_BASE_POST
Definition: rasm.h:480
val
static double val(void *priv, double ch)
Definition: aeval.c:77
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
v_d
static RasmOp v_d(RasmOp op)
Definition: rasm.h:429
AARCH64_INSN_ST2
@ AARCH64_INSN_ST2
Definition: rasm.h:281
RasmFunction::label_id
int label_id
Definition: rasm.h:168
rasm_new_label
int rasm_new_label(RasmContext *rctx, const char *name)
Allocate a new label ID with the given name.
Definition: rasm.c:282
AARCH64_INSN_UXTL2
@ AARCH64_INSN_UXTL2
Definition: rasm.h:299
RasmContext::num_labels
int num_labels
Definition: rasm.h:188
avassert.h
RasmNode::insn
RasmNodeInsn insn
Definition: rasm.h:147
AARCH64_INSN_RET
@ AARCH64_INSN_RET
Definition: rasm.h:276
vv_1
static RasmOp vv_1(RasmOp op0)
Definition: rasm.h:442
a64op_elem
static RasmOp a64op_elem(RasmOp op, uint8_t idx)
Definition: rasm.h:418
rasm_op_imm_val
static int32_t rasm_op_imm_val(RasmOp op)
Definition: rasm.h:86
RasmOp::u8
uint8_t u8[8]
Definition: rasm.h:44
AARCH64_INSN_ORR
@ AARCH64_INSN_ORR
Definition: rasm.h:275
AARCH64_COND_NV
#define AARCH64_COND_NV
Definition: rasm.h:335
a64op_vec8b
static RasmOp a64op_vec8b(uint8_t n)
Definition: rasm.h:385
AArch64VecViews::be
RasmOp be[2]
Definition: rasm.h:468
AArch64VecViews::b
RasmOp b
Definition: rasm.h:454
AARCH64_OP_GPR
@ AARCH64_OP_GPR
Definition: rasm.h:309
AArch64OpType
AArch64OpType
Definition: rasm.h:308
s
#define s(width, name)
Definition: cbs_vp9.c:198
a64op_vec4h
static RasmOp a64op_vec4h(uint8_t n)
Definition: rasm.h:387
AARCH64_COND_LT
#define AARCH64_COND_LT
Definition: rasm.h:331
RasmNode::next
struct RasmNode * next
Definition: rasm.h:155
AARCH64_INSN_UXTL
@ AARCH64_INSN_UXTL
Definition: rasm.h:298
RASM_OP_NONE
@ RASM_OP_NONE
Definition: rasm.h:62
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
rasm_op_none
static RasmOp rasm_op_none(void)
Definition: rasm.h:70
AARCH64_INSN_STP
@ AARCH64_INSN_STP
Definition: rasm.h:284
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:42
AArch64VecViews::d2
RasmOp d2
Definition: rasm.h:466
RasmNode::inline_comment
char * inline_comment
Definition: rasm.h:153
rasm_op_imm
static RasmOp rasm_op_imm(int32_t val)
Definition: rasm.h:79
RasmNodeDirective
Definition: rasm.h:139
a64cond_al
static RasmOp a64cond_al(void)
Definition: rasm.h:528
v_8b
static RasmOp v_8b(RasmOp op)
Definition: rasm.h:433
AARCH64_INSN_NONE
@ AARCH64_INSN_NONE
Definition: rasm.h:244
export
static int export(AVFilterContext *ctx, StreamContext *sc, int input)
Definition: vf_signature.c:558
a64cond_nv
static RasmOp a64cond_nv(void)
Definition: rasm.h:529
RasmEntry::type
RasmEntryType type
Definition: rasm.h:173
AARCH64_COND_HI
#define AARCH64_COND_HI
Definition: rasm.h:328
RasmNodeDirective::text
char * text
Definition: rasm.h:140
RasmNodeInsn::op
RasmOp op[4]
Definition: rasm.h:122
a64op_cond
static RasmOp a64op_cond(int cond)
Definition: rasm.h:503
a64op_make_vec
static RasmOp a64op_make_vec(uint8_t n, uint8_t el_count, uint8_t el_size)
Definition: rasm.h:362
AARCH64_COND_LS
#define AARCH64_COND_LS
Definition: rasm.h:329
a64op_base_imm
static int16_t a64op_base_imm(RasmOp op)
Definition: rasm.h:491
rasm_add_commentf
RasmNode * rasm_add_commentf(RasmContext *rctx, char *s, size_t n, const char *fmt,...) av_printf_format(4
RASM_NODE_ENDFUNC
@ RASM_NODE_ENDFUNC
Definition: rasm.h:115
AARCH64_COND_LE
#define AARCH64_COND_LE
Definition: rasm.h:333
AARCH64_COND_CC
#define AARCH64_COND_CC
Definition: rasm.h:323
RasmNode::func
RasmNodeFunc func
Definition: rasm.h:150
AARCH64_COND_PL
#define AARCH64_COND_PL
Definition: rasm.h:325
v_2s
static RasmOp v_2s(RasmOp op)
Definition: rasm.h:437
AARCH64_INSN_BR
@ AARCH64_INSN_BR
Definition: rasm.h:251
a64cond_vs
static RasmOp a64cond_vs(void)
Definition: rasm.h:520
AArch64VecViews::s4
RasmOp s4
Definition: rasm.h:465
AARCH64_INSN_LD1R
@ AARCH64_INSN_LD1R
Definition: rasm.h:263
a64op_vec2d
static RasmOp a64op_vec2d(uint8_t n)
Definition: rasm.h:391
AARCH64_INSN_TBL
@ AARCH64_INSN_TBL
Definition: rasm.h:288
AARCH64_INSN_MUL
@ AARCH64_INSN_MUL
Definition: rasm.h:274
RasmNodeFunc::jumpable
bool jumpable
Definition: rasm.h:136
RasmNode::comment
RasmNodeComment comment
Definition: rasm.h:148
a64op_vecs
static RasmOp a64op_vecs(uint8_t n)
Definition: rasm.h:382
av_printf_format
#define av_printf_format(fmtpos, attrpos)
Definition: attributes.h:210
RasmFunction::export
bool export
Definition: rasm.h:167
a64cond_lo
static RasmOp a64cond_lo(void)
Definition: rasm.h:516
a64op_post
static RasmOp a64op_post(RasmOp op, int16_t imm)
Definition: rasm.h:498
a64op_veclist
static RasmOp a64op_veclist(RasmOp op0, RasmOp op1, RasmOp op2, RasmOp op3)
Create register-list operand for structured load/store instructions.
Definition: rasm.h:397
RasmNodeComment
Definition: rasm.h:125
RASM_NODE_FUNCTION
@ RASM_NODE_FUNCTION
Definition: rasm.h:114
a64op_vecb
static RasmOp a64op_vecb(uint8_t n)
Definition: rasm.h:380
AARCH64_COND_HS
#define AARCH64_COND_HS
Definition: rasm.h:320
a64op_vech
static RasmOp a64op_vech(uint8_t n)
Definition: rasm.h:381
RasmEntryType
RasmEntryType
Definition: rasm.h:161
rasm_free
void rasm_free(RasmContext **prctx)
Definition: rasm.c:37
a64op_vec4s
static RasmOp a64op_vec4s(uint8_t n)
Definition: rasm.h:390
RasmEntry
Definition: rasm.h:172
AARCH64_INSN_LD1
@ AARCH64_INSN_LD1
Definition: rasm.h:262
AARCH64_COND_EQ
#define AARCH64_COND_EQ
Definition: rasm.h:318
RasmOp::u16
uint16_t u16[4]
Definition: rasm.h:45
AARCH64_INSN_AND
@ AARCH64_INSN_AND
Definition: rasm.h:249
a64op_sp
static RasmOp a64op_sp(void)
Definition: rasm.h:353
a64cond_mi
static RasmOp a64cond_mi(void)
Definition: rasm.h:518
RASM_OP_IMM
@ RASM_OP_IMM
Definition: rasm.h:63
RasmContext::comment_next
char * comment_next
Definition: rasm.h:190
RasmNode::type
RasmNodeType type
Definition: rasm.h:145
rasm_add_comment
RasmNode * rasm_add_comment(RasmContext *rctx, const char *comment)
Definition: rasm.c:117
AARCH64_INSN_ST3
@ AARCH64_INSN_ST3
Definition: rasm.h:282
AARCH64_INSN_ZIP1
@ AARCH64_INSN_ZIP1
Definition: rasm.h:301
RasmOp::u32
uint32_t u32[2]
Definition: rasm.h:46
AARCH64_INSN_ADDV
@ AARCH64_INSN_ADDV
Definition: rasm.h:247
a64op_base_n
static uint8_t a64op_base_n(RasmOp op)
Definition: rasm.h:492
AARCH64_INSN_UQXTN
@ AARCH64_INSN_UQXTN
Definition: rasm.h:293
RASM_NODE_COMMENT
@ RASM_NODE_COMMENT
Definition: rasm.h:112
RasmNodeFunc::name
char * name
Definition: rasm.h:134
size
int size
Definition: twinvq_data.h:10344
AArch64VecViews::h
RasmOp h
Definition: rasm.h:455
AARCH64_INSN_SHL
@ AARCH64_INSN_SHL
Definition: rasm.h:279
AARCH64_INSN_FMIN
@ AARCH64_INSN_FMIN
Definition: rasm.h:258
RasmNodeLabel::id
int id
Definition: rasm.h:130
a64cond_gt
static RasmOp a64cond_gt(void)
Definition: rasm.h:526
rasm_annotate
int void rasm_annotate(RasmContext *rctx, const char *comment)
Definition: rasm.c:243
rasm_alloc
RasmContext * rasm_alloc(void)
Definition: rasm.c:32
a64op_make_gpr
static RasmOp a64op_make_gpr(uint8_t n, uint8_t size)
Definition: rasm.h:340
RasmNodeLabel
Definition: rasm.h:129
AARCH64_INSN_FMLA
@ AARCH64_INSN_FMLA
Definition: rasm.h:259
AARCH64_INSN_CMP
@ AARCH64_INSN_CMP
Definition: rasm.h:252
a64op_vec2s
static RasmOp a64op_vec2s(uint8_t n)
Definition: rasm.h:389
attributes.h
a64op_off
static RasmOp a64op_off(RasmOp op, int16_t imm)
Definition: rasm.h:496
AARCH64_INSN_XTN
@ AARCH64_INSN_XTN
Definition: rasm.h:300
AArch64VecViews::de
RasmOp de[2]
Definition: rasm.h:469
AARCH64_INSN_ADD
@ AARCH64_INSN_ADD
Definition: rasm.h:246
a64op_vec_num_regs
static uint8_t a64op_vec_num_regs(RasmOp op)
Definition: rasm.h:376
v_8h
static RasmOp v_8h(RasmOp op)
Definition: rasm.h:436
vv_4
static RasmOp vv_4(RasmOp op0, RasmOp op1, RasmOp op2, RasmOp op3)
Definition: rasm.h:445
RasmNodeType
RasmNodeType
Definition: rasm.h:110
a64op_vec_el_count
static uint8_t a64op_vec_el_count(RasmOp op)
Definition: rasm.h:374
RasmNodeFunc
Definition: rasm.h:133
RASM_ENTRY_DATA
@ RASM_ENTRY_DATA
Definition: rasm.h:163
AARCH64_INSN_NB
@ AARCH64_INSN_NB
Definition: rasm.h:304
RasmContext
Definition: rasm.h:184
AARCH64_INSN_DUP
@ AARCH64_INSN_DUP
Definition: rasm.h:254
v_s
static RasmOp v_s(RasmOp op)
Definition: rasm.h:428
a64op_vec16b
static RasmOp a64op_vec16b(uint8_t n)
Definition: rasm.h:386
AARCH64_INSN_USHLL2
@ AARCH64_INSN_USHLL2
Definition: rasm.h:296
AARCH64_BASE_PRE
#define AARCH64_BASE_PRE
Definition: rasm.h:479
AARCH64_COND_GT
#define AARCH64_COND_GT
Definition: rasm.h:332
AARCH64_INSN_UBFIZ
@ AARCH64_INSN_UBFIZ
Definition: rasm.h:289
a64op_gpr_size
static uint8_t a64op_gpr_size(RasmOp op)
Definition: rasm.h:349
AARCH64_COND_LO
#define AARCH64_COND_LO
Definition: rasm.h:322
AARCH64_INSN_ZIP2
@ AARCH64_INSN_ZIP2
Definition: rasm.h:302
RasmContext::num_entries
int num_entries
Definition: rasm.h:186
AArch64VecViews::q
RasmOp q
Definition: rasm.h:458
AARCH64_INSN_LD2
@ AARCH64_INSN_LD2
Definition: rasm.h:264
RasmNodeInsn::id
int id
Definition: rasm.h:121
AARCH64_INSN_ST1
@ AARCH64_INSN_ST1
Definition: rasm.h:280
v_2d
static RasmOp v_2d(RasmOp op)
Definition: rasm.h:439
rasm_func_begin
int rasm_func_begin(RasmContext *rctx, const char *name, bool export, bool jumpable)
Definition: rasm.c:209
AARCH64_INSN_CSEL
@ AARCH64_INSN_CSEL
Definition: rasm.h:253
a64op_cond_val
static uint8_t a64op_cond_val(RasmOp op)
Definition: rasm.h:510
AArch64VecViews::h4
RasmOp h4
Definition: rasm.h:462
a64op_base_mode
static uint8_t a64op_base_mode(RasmOp op)
Definition: rasm.h:493
a64op_pre
static RasmOp a64op_pre(RasmOp op, int16_t imm)
Definition: rasm.h:497
a64cond_ge
static RasmOp a64cond_ge(void)
Definition: rasm.h:524
AARCH64_INSN_INS
@ AARCH64_INSN_INS
Definition: rasm.h:261
a64op_vec
static RasmOp a64op_vec(uint8_t n)
Definition: rasm.h:379
a64op_vec_el_size
static uint8_t a64op_vec_el_size(RasmOp op)
Definition: rasm.h:375
a64op_make_base
static RasmOp a64op_make_base(uint8_t n, uint8_t mode, int16_t imm)
Definition: rasm.h:482
a64cond_pl
static RasmOp a64cond_pl(void)
Definition: rasm.h:519
rasm_op_label
static RasmOp rasm_op_label(int id)
Definition: rasm.h:95
RasmNodeComment::text
char * text
Definition: rasm.h:126
AARCH64_OP_BASE
@ AARCH64_OP_BASE
Definition: rasm.h:311
comment
static int FUNC() comment(CodedBitstreamContext *ctx, RWContext *rw, JPEGRawComment *current)
Definition: cbs_jpeg_syntax_template.c:174
AARCH64_OP_VEC
@ AARCH64_OP_VEC
Definition: rasm.h:310
rasm_add_directive
RasmNode * rasm_add_directive(RasmContext *rctx, const char *text)
Definition: rasm.c:174
a64cond_vc
static RasmOp a64cond_vc(void)
Definition: rasm.h:521
v_b
static RasmOp v_b(RasmOp op)
Definition: rasm.h:426
a64op_vec_views
void a64op_vec_views(RasmOp op, AArch64VecViews *out)
Definition: rasm.c:330
AARCH64_INSN_B
@ AARCH64_INSN_B
Definition: rasm.h:250
mode
mode
Definition: ebur128.h:83
RASM_ENTRY_FUNC
@ RASM_ENTRY_FUNC
Definition: rasm.h:162
AARCH64_COND_VS
#define AARCH64_COND_VS
Definition: rasm.h:326
AARCH64_COND_MI
#define AARCH64_COND_MI
Definition: rasm.h:324
v_16b
static RasmOp v_16b(RasmOp op)
Definition: rasm.h:434
RasmNode::directive
RasmNodeDirective directive
Definition: rasm.h:151
v_4h
static RasmOp v_4h(RasmOp op)
Definition: rasm.h:435
AARCH64_INSN_FADD
@ AARCH64_INSN_FADD
Definition: rasm.h:255
AARCH64_INSN_ADR
@ AARCH64_INSN_ADR
Definition: rasm.h:248
AARCH64_OP_COND
@ AARCH64_OP_COND
Definition: rasm.h:312
v_4s
static RasmOp v_4s(RasmOp op)
Definition: rasm.h:438
RasmNodeFunc::export
bool export
Definition: rasm.h:135
AARCH64_INSN_UCVTF
@ AARCH64_INSN_UCVTF
Definition: rasm.h:290
AARCH64_INSN_LSR
@ AARCH64_INSN_LSR
Definition: rasm.h:271
rasm_add_endfunc
RasmNode * rasm_add_endfunc(RasmContext *rctx)
Definition: rasm.c:168
AARCH64_INSN_USHR
@ AARCH64_INSN_USHR
Definition: rasm.h:297
AARCH64_INSN_MOV
@ AARCH64_INSN_MOV
Definition: rasm.h:272
rasm_set_current_node
RasmNode * rasm_set_current_node(RasmContext *rctx, RasmNode *node)
Definition: rasm.c:199
AARCH64_INSN_ST4
@ AARCH64_INSN_ST4
Definition: rasm.h:283
AARCH64_INSN_REV16
@ AARCH64_INSN_REV16
Definition: rasm.h:277
RasmContext::current_node
RasmNode * current_node
Definition: rasm.h:189
AARCH64_BASE_OFFSET
#define AARCH64_BASE_OFFSET
Definition: rasm.h:478
AARCH64_INSN_LDRB
@ AARCH64_INSN_LDRB
Definition: rasm.h:269
a64op_x
static RasmOp a64op_x(RasmOp op)
Definition: rasm.h:357
a64cond_ls
static RasmOp a64cond_ls(void)
Definition: rasm.h:523
rasm_op_label_id
static int rasm_op_label_id(RasmOp op)
Definition: rasm.h:102
a64cond_hs
static RasmOp a64cond_hs(void)
Definition: rasm.h:514
int32_t
int32_t
Definition: audioconvert.c:56
AARCH64_INSN_UMIN
@ AARCH64_INSN_UMIN
Definition: rasm.h:292
a64op_vec8h
static RasmOp a64op_vec8h(uint8_t n)
Definition: rasm.h:388
AARCH64_INSN_LDR
@ AARCH64_INSN_LDR
Definition: rasm.h:268
RasmOp::u64
uint64_t u64
Definition: rasm.h:47
AARCH64_COND_VC
#define AARCH64_COND_VC
Definition: rasm.h:327
AARCH64_OP_NB
@ AARCH64_OP_NB
Definition: rasm.h:314
rasm_annotate_nextf
void rasm_annotate_nextf(RasmContext *rctx, char *s, size_t n, const char *fmt,...) av_printf_format(4
RasmEntry::start
RasmNode * start
Definition: rasm.h:174
rasm_new_labelf
int rasm_new_labelf(RasmContext *rctx, char *s, size_t n, const char *fmt,...) av_printf_format(4
RasmFunction
Definition: rasm.h:166
cond
int(* cond)(enum AVPixelFormat pix_fmt)
Definition: pixdesc_query.c:28
a64cond_hi
static RasmOp a64cond_hi(void)
Definition: rasm.h:522
AARCH64_INSN_LD4
@ AARCH64_INSN_LD4
Definition: rasm.h:266
a64op_gpr_n
static uint8_t a64op_gpr_n(RasmOp op)
Definition: rasm.h:348
v_q
static RasmOp v_q(RasmOp op)
Definition: rasm.h:430
AArch64VecViews::b8
RasmOp b8
Definition: rasm.h:460