summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorge Zapata <jorgeluis.zapata@gmail.com>2024-01-04 13:09:38 +0100
committerJorge Zapata <jorgeluis.zapata@gmail.com>2024-03-12 10:03:58 +0100
commitc620cc2516085132190d65fb57f4eae0f4d6f201 (patch)
tree6f8b850d32465bbd90851efcbb66d967685af276
parent18ce3d19dd4cc15de96c1d7abd3eb47cba7b00b3 (diff)
Refactor the naming
OrcSys refers to the Sys instruction set, not the x86 architecture OrcX86Opcode refers to the index, not the actual Opcode Part-of: <https://gitlab.freedesktop.org/gstreamer/orc/-/merge_requests/148>
-rw-r--r--orc/orcx86insn.c46
-rw-r--r--orc/orcx86insn.h10
2 files changed, 28 insertions, 28 deletions
diff --git a/orc/orcx86insn.c b/orc/orcx86insn.c
index a843993..6d4852c 100644
--- a/orc/orcx86insn.c
+++ b/orc/orcx86insn.c
@@ -40,7 +40,7 @@
// Special instruction that uses 66 but not the escape 0F
#define ORC_SKIP_ESCAPE (1U << 6)
-static const OrcSysOpcode orc_x86_opcodes[] = {
+static const OrcX86Opcode orc_x86_opcodes[] = {
{ "punpcklbw", ORC_X86_INSN_TYPE_MMXM_MMX, 0, ORC_SIMD_PREFIX_MMX, 0x60 },
{ "punpcklwd", ORC_X86_INSN_TYPE_MMXM_MMX, 0, ORC_SIMD_PREFIX_MMX, 0x61 },
{ "punpckldq", ORC_X86_INSN_TYPE_MMXM_MMX, 0, ORC_SIMD_PREFIX_MMX, 0x62 },
@@ -307,7 +307,7 @@ static const OrcSysOpcode orc_x86_opcodes[] = {
};
static void
-output_opcode (OrcCompiler *p, const OrcSysOpcode *opcode, int size,
+output_opcode (OrcCompiler *p, const OrcX86Opcode *opcode, int size,
int src, int dest, OrcX86OpcodePrefix reg_type)
{
ORC_ASSERT(opcode->code != 0 || opcode->prefix != 0 || opcode->flags != 0);
@@ -1815,7 +1815,7 @@ void
orc_x86_emit_cpuinsn_size (OrcCompiler *p, int index, int size, int src, int dest)
{
OrcX86Insn *xinsn = orc_x86_get_output_insn (p);
- const OrcSysOpcode *opcode = orc_x86_opcodes + index;
+ const OrcX86Opcode *opcode = orc_x86_opcodes + index;
xinsn->opcode_index = index;
xinsn->opcode = opcode;
@@ -1829,7 +1829,7 @@ void
orc_x86_emit_cpuinsn_imm (OrcCompiler *p, int index, int imm, int src, int dest)
{
OrcX86Insn *xinsn = orc_x86_get_output_insn (p);
- const OrcSysOpcode *opcode = orc_x86_opcodes + index;
+ const OrcX86Opcode *opcode = orc_x86_opcodes + index;
xinsn->opcode_index = index;
xinsn->opcode = opcode;
@@ -1845,7 +1845,7 @@ orc_x86_emit_cpuinsn_load_memoffset (OrcCompiler *p, int index, int size,
int imm, int offset, int src, int dest)
{
OrcX86Insn *xinsn = orc_x86_get_output_insn (p);
- const OrcSysOpcode *opcode = orc_x86_opcodes + index;
+ const OrcX86Opcode *opcode = orc_x86_opcodes + index;
xinsn->opcode_index = index;
xinsn->opcode = opcode;
@@ -1862,7 +1862,7 @@ orc_x86_emit_cpuinsn_store_memoffset (OrcCompiler *p, int index, int size,
int imm, int offset, int src, int dest)
{
OrcX86Insn *xinsn = orc_x86_get_output_insn (p);
- const OrcSysOpcode *opcode = orc_x86_opcodes + index;
+ const OrcX86Opcode *opcode = orc_x86_opcodes + index;
xinsn->opcode_index = index;
xinsn->opcode = opcode;
@@ -1879,7 +1879,7 @@ orc_x86_emit_cpuinsn_load_memindex (OrcCompiler *p, int index, int size,
int imm, int offset, int src, int src_index, int shift, int dest)
{
OrcX86Insn *xinsn = orc_x86_get_output_insn (p);
- const OrcSysOpcode *opcode = orc_x86_opcodes + index;
+ const OrcX86Opcode *opcode = orc_x86_opcodes + index;
xinsn->opcode_index = index;
xinsn->opcode = opcode;
@@ -1898,7 +1898,7 @@ orc_x86_emit_cpuinsn_imm_reg (OrcCompiler *p, int index, int size, int imm,
int dest)
{
OrcX86Insn *xinsn = orc_x86_get_output_insn (p);
- const OrcSysOpcode *opcode = orc_x86_opcodes + index;
+ const OrcX86Opcode *opcode = orc_x86_opcodes + index;
xinsn->opcode_index = index;
xinsn->opcode = opcode;
@@ -1914,7 +1914,7 @@ orc_x86_emit_cpuinsn_imm_memoffset (OrcCompiler *p, int index, int size,
int imm, int offset, int dest)
{
OrcX86Insn *xinsn = orc_x86_get_output_insn (p);
- const OrcSysOpcode *opcode = orc_x86_opcodes + index;
+ const OrcX86Opcode *opcode = orc_x86_opcodes + index;
xinsn->opcode_index = index;
xinsn->opcode = opcode;
@@ -1945,7 +1945,7 @@ orc_x86_emit_cpuinsn_reg_memoffset_s (OrcCompiler *p, int index, int size,
int src, int offset, int dest)
{
OrcX86Insn *xinsn = orc_x86_get_output_insn (p);
- const OrcSysOpcode *opcode = orc_x86_opcodes + index;
+ const OrcX86Opcode *opcode = orc_x86_opcodes + index;
xinsn->opcode_index = index;
xinsn->opcode = opcode;
@@ -1961,7 +1961,7 @@ orc_x86_emit_cpuinsn_memoffset_reg (OrcCompiler *p, int index, int size,
int offset, int src, int dest)
{
OrcX86Insn *xinsn = orc_x86_get_output_insn (p);
- const OrcSysOpcode *opcode = orc_x86_opcodes + index;
+ const OrcX86Opcode *opcode = orc_x86_opcodes + index;
xinsn->opcode_index = index;
xinsn->opcode = opcode;
@@ -1976,7 +1976,7 @@ void
orc_x86_emit_cpuinsn_branch (OrcCompiler *p, int index, int label)
{
OrcX86Insn *xinsn = orc_x86_get_output_insn (p);
- const OrcSysOpcode *opcode = orc_x86_opcodes + index;
+ const OrcX86Opcode *opcode = orc_x86_opcodes + index;
xinsn->opcode_index = index;
xinsn->opcode = opcode;
@@ -1988,7 +1988,7 @@ void
orc_x86_emit_cpuinsn_align (OrcCompiler *p, int index, int align_shift)
{
OrcX86Insn *xinsn = orc_x86_get_output_insn (p);
- const OrcSysOpcode *opcode = orc_x86_opcodes + index;
+ const OrcX86Opcode *opcode = orc_x86_opcodes + index;
xinsn->opcode_index = index;
xinsn->opcode = opcode;
@@ -1999,7 +1999,7 @@ void
orc_x86_emit_cpuinsn_label (OrcCompiler *p, int index, int label)
{
OrcX86Insn *xinsn = orc_x86_get_output_insn (p);
- const OrcSysOpcode *opcode = orc_x86_opcodes + index;
+ const OrcX86Opcode *opcode = orc_x86_opcodes + index;
xinsn->opcode_index = index;
xinsn->opcode = opcode;
@@ -2011,7 +2011,7 @@ void
orc_x86_emit_cpuinsn_none (OrcCompiler *p, int index)
{
OrcX86Insn *xinsn = orc_x86_get_output_insn (p);
- const OrcSysOpcode *opcode = orc_x86_opcodes + index;
+ const OrcX86Opcode *opcode = orc_x86_opcodes + index;
int size = 4;
xinsn->opcode_index = index;
@@ -2024,7 +2024,7 @@ orc_x86_emit_cpuinsn_memoffset (OrcCompiler *p, int index, int size,
int offset, int srcdest)
{
OrcX86Insn *xinsn = orc_x86_get_output_insn (p);
- const OrcSysOpcode *opcode = orc_x86_opcodes + index;
+ const OrcX86Opcode *opcode = orc_x86_opcodes + index;
xinsn->opcode_index = index;
xinsn->opcode = opcode;
@@ -2040,7 +2040,7 @@ orc_vex_emit_cpuinsn_none (OrcCompiler *p, const int index,
const OrcX86OpcodePrefix prefix)
{
OrcX86Insn *xinsn = orc_x86_get_output_insn (p);
- const OrcSysOpcode *opcode = orc_x86_opcodes + index;
+ const OrcX86Opcode *opcode = orc_x86_opcodes + index;
int size = 4;
xinsn->opcode_index = index;
@@ -2055,7 +2055,7 @@ orc_vex_emit_cpuinsn_size (OrcCompiler *const p, const int index,
const OrcX86OpcodePrefix prefix)
{
OrcX86Insn *xinsn = orc_x86_get_output_insn (p);
- const OrcSysOpcode *const opcode = orc_x86_opcodes + index;
+ const OrcX86Opcode *const opcode = orc_x86_opcodes + index;
xinsn->opcode_index = index;
xinsn->opcode = opcode;
@@ -2072,7 +2072,7 @@ void
orc_vex_emit_cpuinsn_imm (OrcCompiler *const p, const int index, const int imm, const int src0, const int src1, const int dest, const OrcX86OpcodePrefix prefix)
{
OrcX86Insn *xinsn = orc_x86_get_output_insn (p);
- const OrcSysOpcode *opcode = orc_x86_opcodes + index;
+ const OrcX86Opcode *opcode = orc_x86_opcodes + index;
xinsn->opcode_index = index;
xinsn->opcode = opcode;
@@ -2092,7 +2092,7 @@ orc_vex_emit_cpuinsn_load_memoffset (OrcCompiler *const p, const int index,
const int src1, const int dest, const OrcX86OpcodePrefix prefix)
{
OrcX86Insn *xinsn = orc_x86_get_output_insn (p);
- const OrcSysOpcode *opcode = orc_x86_opcodes + index;
+ const OrcX86Opcode *opcode = orc_x86_opcodes + index;
xinsn->opcode_index = index;
xinsn->opcode = opcode;
@@ -2113,7 +2113,7 @@ orc_vex_emit_cpuinsn_store_memoffset (OrcCompiler *const p, const int index,
const int dest, const OrcX86OpcodePrefix prefix)
{
OrcX86Insn *xinsn = orc_x86_get_output_insn (p);
- const OrcSysOpcode *opcode = orc_x86_opcodes + index;
+ const OrcX86Opcode *opcode = orc_x86_opcodes + index;
xinsn->opcode_index = index;
xinsn->opcode = opcode;
@@ -2131,7 +2131,7 @@ orc_vex_emit_cpuinsn_load_memindex (OrcCompiler *const p, const int index, const
const int imm, const int offset, const int src, const int src_index, const int shift, int dest, const OrcX86OpcodePrefix prefix)
{
OrcX86Insn *xinsn = orc_x86_get_output_insn (p);
- const OrcSysOpcode *opcode = orc_x86_opcodes + index;
+ const OrcX86Opcode *opcode = orc_x86_opcodes + index;
xinsn->opcode_index = index;
xinsn->opcode = opcode;
@@ -2152,7 +2152,7 @@ orc_vex_emit_blend_size (OrcCompiler *const p, const int index,
const int dest, const OrcX86OpcodePrefix prefix)
{
OrcX86Insn *xinsn = orc_x86_get_output_insn (p);
- const OrcSysOpcode *const opcode = orc_x86_opcodes + index;
+ const OrcX86Opcode *const opcode = orc_x86_opcodes + index;
xinsn->opcode_index = index;
xinsn->opcode = opcode;
diff --git a/orc/orcx86insn.h b/orc/orcx86insn.h
index 65d8a00..6ec953d 100644
--- a/orc/orcx86insn.h
+++ b/orc/orcx86insn.h
@@ -305,7 +305,7 @@ typedef enum
ORC_X86_andps,
ORC_X86_orps,
ORC_X86_blendvpd_sse,
-} OrcX86Opcode;
+} OrcX86OpcodeIdx;
typedef enum {
ORC_X86_RM_REG, /* operand can be register or memory */
@@ -320,7 +320,7 @@ typedef enum {
ORC_X86_AVX_VEX256_PREFIX,
} OrcX86OpcodePrefix;
-struct _OrcSysOpcode {
+struct _OrcX86Opcode {
// Mnemonic
char name[16];
// Type of instruction (source instruction set, operation type)
@@ -341,16 +341,16 @@ struct _OrcSysOpcode {
int code2;
};
-typedef struct _OrcSysOpcode OrcSysOpcode;
+typedef struct _OrcX86Opcode OrcX86Opcode;
#define ORC_SYS_OPCODE_FLAG_FIXED (1<<0)
typedef struct _OrcX86Insn OrcX86Insn;
struct _OrcX86Insn {
// Index into the opcode table
- OrcX86Opcode opcode_index;
+ OrcX86OpcodeIdx opcode_index;
// The opcode the index points to
- const OrcSysOpcode *opcode;
+ const OrcX86Opcode *opcode;
// What version should we encode?
// SSE (without), VEX with SSE vectors,
// VEX with AVX vectors...