"Fossies" - the Fresh Open Source Software Archive

Member "glusterfs-8.2/xlators/cluster/ec/src/ec-code-intel.h" (16 Sep 2020, 5691 Bytes) of package /linux/misc/glusterfs-8.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ec-code-intel.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2   Copyright (c) 2015 DataLab, s.l. <http://www.datalab.es>
    3   This file is part of GlusterFS.
    4 
    5   This file is licensed to you under your choice of the GNU Lesser
    6   General Public License, version 3 or any later version (LGPLv3 or
    7   later), or the GNU General Public License, version 2 (GPLv2), in all
    8   cases as published by the Free Software Foundation.
    9 */
   10 
   11 #ifndef __EC_CODE_INTEL_H__
   12 #define __EC_CODE_INTEL_H__
   13 
   14 #include "ec-code.h"
   15 
   16 #define VEX_REG_NONE 0
   17 
   18 enum _ec_code_intel_reg;
   19 typedef enum _ec_code_intel_reg ec_code_intel_reg_t;
   20 
   21 enum _ec_code_vex_prefix;
   22 typedef enum _ec_code_vex_prefix ec_code_vex_prefix_t;
   23 
   24 enum _ec_code_vex_opcode;
   25 typedef enum _ec_code_vex_opcode ec_code_vex_opcode_t;
   26 
   27 struct _ec_code_intel_buffer;
   28 typedef struct _ec_code_intel_buffer ec_code_intel_buffer_t;
   29 
   30 struct _ec_code_intel_sib;
   31 typedef struct _ec_code_intel_sib ec_code_intel_sib_t;
   32 
   33 struct _ec_code_intel_modrm;
   34 typedef struct _ec_code_intel_modrm ec_code_intel_modrm_t;
   35 
   36 struct _ec_code_intel_rex;
   37 typedef struct _ec_code_intel_rex ec_code_intel_rex_t;
   38 
   39 struct _ec_code_intel;
   40 typedef struct _ec_code_intel ec_code_intel_t;
   41 
   42 enum _ec_code_intel_reg {
   43     REG_NULL = -1,
   44     REG_AX,
   45     REG_CX,
   46     REG_DX,
   47     REG_BX,
   48     REG_SP,
   49     REG_BP,
   50     REG_SI,
   51     REG_DI,
   52     REG_8,
   53     REG_9,
   54     REG_10,
   55     REG_11,
   56     REG_12,
   57     REG_13,
   58     REG_14,
   59     REG_15
   60 };
   61 
   62 enum _ec_code_vex_prefix {
   63     VEX_PREFIX_NONE = 0,
   64     VEX_PREFIX_66,
   65     VEX_PREFIX_F3,
   66     VEX_PREFIX_F2
   67 };
   68 
   69 enum _ec_code_vex_opcode {
   70     VEX_OPCODE_NONE = 0,
   71     VEX_OPCODE_0F,
   72     VEX_OPCODE_0F_38,
   73     VEX_OPCODE_0F_3A
   74 };
   75 
   76 struct _ec_code_intel_buffer {
   77     uint32_t bytes;
   78     union {
   79         uint8_t data[4];
   80         uint32_t value;
   81     };
   82 };
   83 
   84 struct _ec_code_intel_sib {
   85     gf_boolean_t present;
   86     uint32_t base;
   87     uint32_t index;
   88     uint32_t scale;
   89 };
   90 
   91 struct _ec_code_intel_modrm {
   92     gf_boolean_t present;
   93     uint32_t mod;
   94     uint32_t rm;
   95     uint32_t reg;
   96 };
   97 
   98 struct _ec_code_intel_rex {
   99     gf_boolean_t present;
  100     uint32_t w;
  101     uint32_t r;
  102     uint32_t x;
  103     uint32_t b;
  104 };
  105 
  106 struct _ec_code_intel {
  107     gf_boolean_t invalid;
  108     ec_code_intel_buffer_t prefix;
  109     ec_code_intel_buffer_t opcode;
  110     ec_code_intel_buffer_t offset;
  111     ec_code_intel_buffer_t immediate;
  112     ec_code_intel_buffer_t vex;
  113     ec_code_intel_rex_t rex;
  114     ec_code_intel_modrm_t modrm;
  115     ec_code_intel_sib_t sib;
  116     uint32_t reg;
  117 };
  118 
  119 void
  120 ec_code_intel_op_push_r(ec_code_builder_t *builder, ec_code_intel_reg_t reg);
  121 void
  122 ec_code_intel_op_pop_r(ec_code_builder_t *builder, ec_code_intel_reg_t reg);
  123 void
  124 ec_code_intel_op_ret(ec_code_builder_t *builder, uint32_t size);
  125 
  126 void
  127 ec_code_intel_op_mov_r2r(ec_code_builder_t *builder, ec_code_intel_reg_t src,
  128                          ec_code_intel_reg_t dst);
  129 void
  130 ec_code_intel_op_mov_r2m(ec_code_builder_t *builder, ec_code_intel_reg_t src,
  131                          ec_code_intel_reg_t base, ec_code_intel_reg_t index,
  132                          uint32_t scale, int32_t offset);
  133 void
  134 ec_code_intel_op_mov_m2r(ec_code_builder_t *builder, ec_code_intel_reg_t base,
  135                          ec_code_intel_reg_t index, uint32_t scale,
  136                          int32_t offset, ec_code_intel_reg_t dst);
  137 void
  138 ec_code_intel_op_xor_r2r(ec_code_builder_t *builder, ec_code_intel_reg_t src,
  139                          ec_code_intel_reg_t dst);
  140 void
  141 ec_code_intel_op_xor_m2r(ec_code_builder_t *builder, ec_code_intel_reg_t base,
  142                          ec_code_intel_reg_t index, uint32_t scale,
  143                          int32_t offset, ec_code_intel_reg_t dst);
  144 void
  145 ec_code_intel_op_add_i2r(ec_code_builder_t *builder, int32_t value,
  146                          ec_code_intel_reg_t reg);
  147 void
  148 ec_code_intel_op_test_i2r(ec_code_builder_t *builder, uint32_t value,
  149                           ec_code_intel_reg_t reg);
  150 void
  151 ec_code_intel_op_jne(ec_code_builder_t *builder, uint32_t address);
  152 
  153 void
  154 ec_code_intel_op_mov_sse2sse(ec_code_builder_t *builder, uint32_t src,
  155                              uint32_t dst);
  156 void
  157 ec_code_intel_op_mov_sse2m(ec_code_builder_t *builder, uint32_t src,
  158                            ec_code_intel_reg_t base, ec_code_intel_reg_t index,
  159                            uint32_t scale, int32_t offset);
  160 void
  161 ec_code_intel_op_mov_m2sse(ec_code_builder_t *builder, ec_code_intel_reg_t base,
  162                            ec_code_intel_reg_t index, uint32_t scale,
  163                            int32_t offset, uint32_t dst);
  164 void
  165 ec_code_intel_op_xor_sse2sse(ec_code_builder_t *builder, uint32_t src,
  166                              uint32_t dst);
  167 void
  168 ec_code_intel_op_xor_m2sse(ec_code_builder_t *builder, ec_code_intel_reg_t base,
  169                            ec_code_intel_reg_t index, uint32_t scale,
  170                            int32_t offset, uint32_t dst);
  171 
  172 void
  173 ec_code_intel_op_mov_avx2avx(ec_code_builder_t *builder, uint32_t src,
  174                              uint32_t dst);
  175 void
  176 ec_code_intel_op_mov_avx2m(ec_code_builder_t *builder, uint32_t src,
  177                            ec_code_intel_reg_t base, ec_code_intel_reg_t index,
  178                            uint32_t scale, int32_t offset);
  179 void
  180 ec_code_intel_op_mov_m2avx(ec_code_builder_t *builder, ec_code_intel_reg_t base,
  181                            ec_code_intel_reg_t index, uint32_t scale,
  182                            int32_t offset, uint32_t dst);
  183 void
  184 ec_code_intel_op_xor_avx2avx(ec_code_builder_t *builder, uint32_t src,
  185                              uint32_t dst);
  186 void
  187 ec_code_intel_op_xor_m2avx(ec_code_builder_t *builder, ec_code_intel_reg_t base,
  188                            ec_code_intel_reg_t index, uint32_t scale,
  189                            int32_t offset, uint32_t dst);
  190 
  191 #endif /* __EC_CODE_INTEL_H__ */