ae2f_docs
Loading...
Searching...
No Matches
wrdemit.h File Reference

word emission utilities More...

#include <stddef.h>
#include <aclspv/spvty.h>
#include <ae2f/c90/StdInt.h>
#include <ae2f/Keys.h>
#include <assert.h>
#include <string.h>
#include "./ctx.h"

Go to the source code of this file.

Macros

#define sz_to_count(c_sz)
 byte size to word count
#define count_to_sz(c_count)
 word count to byte size
#define get_wrd_of_vec(vec)
 get word buffer from vector
#define mk_noprnds(c_num_opprm)
#define opcode_to_wrd(c_opcode, c_num_opprm)
#define emit_opcode(h_wrds, c_wrdcount, c_opcode, c_num_opprm_opt)
 try emit opcode with num_opprm
#define set_oprnd_count_for_opcode(cr_wrd, c_num_opprm)

Typedefs

typedef aclspv_wrdcount_t spvsz_t

Detailed Description

word emission utilities

Definition in file wrdemit.h.

Macro Definition Documentation

◆ count_to_sz

#define count_to_sz ( c_count)
Value:
((spvsz_t)(((spvsz_t)(c_count)) * (spvsz_t)(sizeof(aclspv_wrd_t))))
#define aclspv_wrd_t
integer as word
Definition spvty.h:16
aclspv_wrdcount_t spvsz_t
Definition wrdemit.h:18

word count to byte size

Definition at line 32 of file wrdemit.h.

◆ emit_opcode

#define emit_opcode ( h_wrds,
c_wrdcount,
c_opcode,
c_num_opprm_opt )
Value:
(util_emit_wrd(h_wrds, c_wrdcount, opcode_to_wrd(c_opcode, c_num_opprm_opt)))

try emit opcode with num_opprm

Definition at line 75 of file wrdemit.h.

◆ get_wrd_of_vec

#define get_wrd_of_vec ( vec)
Value:
((aclspv_wrd_t* ae2f_restrict)((vec)->m_p))
#define ae2f_restrict
Keyword as restrict on C99.
Definition cc.h:81

get word buffer from vector

Definition at line 38 of file wrdemit.h.

◆ mk_noprnds

#define mk_noprnds ( c_num_opprm)
Value:
((((aclspv_wrd_t)((c_num_opprm) + 1)) << 16) & (aclspv_wrd_t)ACLSPV_MASK_NOPRNDS)
#define ACLSPV_MASK_NOPRNDS
mask for number of operands
Definition spvty.h:42

Definition at line 66 of file wrdemit.h.

◆ opcode_to_wrd

#define opcode_to_wrd ( c_opcode,
c_num_opprm )
Value:
((aclspv_wrd_t)(((aclspv_wrd_t)(c_opcode) & ACLSPV_MASK_OPCODE) | mk_noprnds(c_num_opprm)))
#define ACLSPV_MASK_OPCODE
mask for opcode
Definition spvty.h:37

Definition at line 69 of file wrdemit.h.

◆ set_oprnd_count_for_opcode

#define set_oprnd_count_for_opcode ( cr_wrd,
c_num_opprm )
Value:
(cr_wrd) = opcode_to_wrd((cr_wrd & ACLSPV_MASK_OPCODE), ((aclspv_num_opprm_t)(c_num_opprm)))

Definition at line 78 of file wrdemit.h.

◆ sz_to_count

#define sz_to_count ( c_sz)
Value:
(((spvsz_t)(c_sz) + (spvsz_t)(sizeof(aclspv_wrd_t)) - 1) / (spvsz_t)(sizeof(aclspv_wrd_t)))

byte size to word count

Definition at line 24 of file wrdemit.h.

Typedef Documentation

◆ spvsz_t

size_t for spir-v format

Definition at line 18 of file wrdemit.h.