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