15
15
namespace ov {
16
16
namespace reference {
17
17
namespace jit {
18
- #ifdef XBYAK64
19
18
static const Xbyak::Operand::Code abi_save_gpr_regs[] = {
20
19
Xbyak::Operand::RBX,
21
20
Xbyak::Operand::RBP,
22
21
Xbyak::Operand::R12,
23
22
Xbyak::Operand::R13,
24
23
Xbyak::Operand::R14,
25
24
Xbyak::Operand::R15,
26
- # ifdef _WIN32
25
+ #ifdef _WIN32
27
26
Xbyak::Operand::RDI,
28
27
Xbyak::Operand::RSI,
29
- # endif
28
+ #endif
30
29
};
31
30
32
- # ifdef _WIN32
33
- # define abi_param1 Xbyak::Reg64 (Xbyak::Operand::RCX) // RCX
34
- # else
35
- # define abi_param1 Xbyak::Reg64 (Xbyak::Operand::RDI) // RDI
36
- # endif
37
- #endif // XBYAK64
31
+ #ifdef _WIN32
32
+ # define abi_param1 Xbyak::Reg64 (Xbyak::Operand::RCX) // RCX
33
+ #else
34
+ # define abi_param1 Xbyak::Reg64 (Xbyak::Operand::RDI) // RDI
35
+ #endif
38
36
39
- class Generator : public Xbyak ::CodeGenerator {
40
- static constexpr size_t xmm_len = 16 ;
37
+ typedef enum {
38
+ isa_any,
39
+ sse42,
40
+ avx,
41
+ avx2,
42
+ avx512_common,
43
+ avx512_core,
44
+ avx512_core_vnni,
45
+ avx512_mic,
46
+ avx512_mic_4ops,
47
+ avx512_core_bf16,
48
+ avx512_vpopcnt,
49
+ fp16,
50
+ pclmulqdq,
51
+ vpclmulqdq
52
+ } cpu_isa_t ;
41
53
54
+ class Generator : public Xbyak ::CodeGenerator {
42
55
#ifdef _WIN32
43
- static constexpr size_t xmm_to_preserve_start = 6 ;
44
- static constexpr size_t xmm_to_preserve = 10 ;
56
+ static constexpr size_t xmm_to_preserve_start = 6llu ;
57
+ static constexpr size_t xmm_to_preserve = 10llu ;
45
58
#else
46
- static constexpr size_t xmm_to_preserve_start = 0 ;
47
- static constexpr size_t xmm_to_preserve = 0 ;
59
+ static constexpr size_t xmm_to_preserve_start = 0lu ;
60
+ static constexpr size_t xmm_to_preserve = 0lu ;
48
61
#endif
49
62
50
63
static const size_t num_abi_save_gpr_regs = sizeof (abi_save_gpr_regs) / sizeof (abi_save_gpr_regs[0 ]);
51
64
const size_t size_of_abi_save_regs;
52
65
53
66
const Xbyak::Reg64 reg_EVEX_max_8b_offt;
54
67
static constexpr int EVEX_max_8b_offt = 0x200 ;
68
+ size_t m_vlen = ymm_len;
55
69
56
70
public:
57
- const Xbyak::Reg64 param = abi_param1;
71
+ static constexpr size_t xmm_len = 16lu;
72
+ static constexpr size_t ymm_len = 32lu;
73
+ static constexpr size_t zmm_len = 64lu;
58
74
59
- typedef enum {
60
- isa_any,
61
- sse42,
62
- avx,
63
- avx2,
64
- avx512_common,
65
- avx512_core,
66
- avx512_core_vnni,
67
- avx512_mic,
68
- avx512_mic_4ops,
69
- avx512_core_bf16,
70
- avx512_vpopcnt,
71
- fp16
72
- } cpu_isa_t ;
75
+ const Xbyak::Reg64 param = abi_param1;
73
76
74
77
static bool mayiuse (const cpu_isa_t cpu_isa);
75
78
static bool is_x64 ();
76
79
77
- Generator (void * code_ptr = nullptr , size_t code_size = 16 * 1024 );
80
+ Generator (cpu_isa_t isa = avx2, void * code_ptr = nullptr , size_t code_size = 16lu * 1024lu );
78
81
void preamble ();
79
82
void postamble ();
80
83
@@ -85,7 +88,12 @@ class Generator : public Xbyak::CodeGenerator {
85
88
86
89
template <typename T>
87
90
void copy (const Xbyak::Reg64& dst, const Xbyak::Reg64& src, const Xbyak::Reg64& size);
91
+
92
+ size_t get_vlen () {
93
+ return m_vlen;
94
+ }
88
95
};
96
+
89
97
} // namespace jit
90
98
} // namespace reference
91
99
} // namespace ov
0 commit comments