remove branch conflict
This commit is contained in:
@@ -141,34 +141,14 @@ typedef void(SN_DECL *PNL_PROC_LRAS)(mat_panel *left, mat_panel *right, mat_pane
|
||||
typedef void(SN_DECL *PNL_PROC_RAS)(mat_panel *right, mat_panel *ans, scalar_pack *scalar);
|
||||
|
||||
#define PNL_PROC(T_type, T_arch, T_op_name) T_type##_pnl_##T_op_name##_##T_arch
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
#define DECLARE_PNL_PROC_ANS(T_type, T_arch, T_op_name) \
|
||||
INTERNAL void SN_DECL PNL_PROC(T_type, T_arch, \
|
||||
T_op_name)(MAT_PANEL_##T_arch##(T_type) *restrict ans)
|
||||
=======
|
||||
|
||||
>>>>>>> 7bcb460a3994dda40f24cae0044b5a36f4f16515
|
||||
=======
|
||||
#define DECLARE_PNL_PROC_ANS(T_type, T_arch, T_op_name) \
|
||||
INTERNAL void SN_DECL PNL_PROC(T_type, T_arch, \
|
||||
T_op_name)(MAT_PANEL_##T_arch##(T_type) *restrict ans)
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
#define DECLARE_PNL_PROC_LEFT_RIGHT_ANS(T_type, T_arch, T_op_name) \
|
||||
INTERNAL void SN_DECL PNL_PROC(T_type, T_arch, \
|
||||
T_op_name)(MAT_PANEL_##T_arch##(T_type) const *left, \
|
||||
MAT_PANEL_##T_arch##(T_type) const *right, \
|
||||
MAT_PANEL_##T_arch##(T_type) *restrict ans)
|
||||
#define DECLARE_PNL_PROC_LEFT_RIGHT_ANS(T_type, T_arch, T_op_name) \
|
||||
INTERNAL void SN_DECL PNL_PROC(T_type, T_arch, \
|
||||
T_op_name)(MAT_PANEL_##T_arch##(T_type) const *left, \
|
||||
MAT_PANEL_##T_arch##(T_type) const *right, \
|
||||
MAT_PANEL_##T_arch##(T_type) *restrict ans)
|
||||
#define DECLARE_PNL_PROC_LEFT_RIGHT_ANS_SCALAR(T_type, T_arch, T_op_name) \
|
||||
INTERNAL void SN_DECL PNL_PROC(T_type, T_arch, T_op_name)( \
|
||||
MAT_PANEL_##T_arch##(T_type) const *left, \
|
||||
MAT_PANEL_##T_arch##(T_type) const *right, \
|
||||
MAT_PANEL_##T_arch##(T_type) *restrict ans, scalar_pack const *scalar)
|
||||
#define DECLARE_PNL_PROC_LEFT_RIGHT_ANS_SCALAR(T_type, T_arch, T_op_name) \
|
||||
INTERNAL void SN_DECL PNL_PROC(T_type, T_arch, T_op_name)( \
|
||||
MAT_PANEL_##T_arch##(T_type) const *left, \
|
||||
@@ -249,11 +229,6 @@ DECLARE_BUF_PROC_ANS_SCALAR(float, 512, fill);
|
||||
#pragma endregion
|
||||
|
||||
#pragma region fma
|
||||
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
DECLARE_PNL_PROC_ANS(float, sse, clear);
|
||||
DECLARE_PNL_PROC_ANS(float, avx, clear);
|
||||
DECLARE_PNL_PROC_ANS(float, 512, clear);
|
||||
@@ -262,13 +237,6 @@ DECLARE_PNL_PROC_LEFT_RIGHT_ANS(float, sse, fma);
|
||||
DECLARE_PNL_PROC_LEFT_RIGHT_ANS(float, avx, fma);
|
||||
DECLARE_PNL_PROC_LEFT_RIGHT_ANS(float, avx_fma, fma);
|
||||
DECLARE_PNL_PROC_LEFT_RIGHT_ANS(float, 512, fma);
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
DECLARE_PNL_PROC_LEFT_RIGHT_ANS(float, sse, fma);
|
||||
DECLARE_PNL_PROC_LEFT_RIGHT_ANS(float, avx, fma);
|
||||
>>>>>>> 7bcb460a3994dda40f24cae0044b5a36f4f16515
|
||||
=======
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
|
||||
#pragma endregion
|
||||
|
||||
@@ -310,14 +278,7 @@ typedef struct sn_intrinsic {
|
||||
BUF_PROC_LRA f32_buffer_sub;
|
||||
KER_PROC_RA f32_buffer_transpose;
|
||||
PANEL_PROC f32_build_panel;
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
PANEL_PROC f32_clear_panel;
|
||||
=======
|
||||
>>>>>>> 7bcb460a3994dda40f24cae0044b5a36f4f16515
|
||||
=======
|
||||
PANEL_PROC f32_clear_panel;
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
VECTORNORMALIZEPROC f32_normalize_3;
|
||||
PNL_PROC_LRA f32_panel_fma;
|
||||
PANEL_PROC f32_store_panel;
|
||||
|
||||
@@ -117,26 +117,12 @@ extern __declspec(align(64)) sn_zero_kernel_u64 SN_ZERO_KERNEL;
|
||||
int col_index, int row_index)
|
||||
|
||||
/* Declarations for AVX float variant */
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
DECLARE_BUILD_PANEL(sse, float);
|
||||
DECLARE_BUILD_PANEL(avx, float);
|
||||
DECLARE_BUILD_PANEL(512, float);
|
||||
DECLARE_STORE_PANEL(sse, float);
|
||||
DECLARE_STORE_PANEL(avx, float);
|
||||
DECLARE_STORE_PANEL(512, float);
|
||||
=======
|
||||
=======
|
||||
DECLARE_BUILD_PANEL(sse, float);
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
DECLARE_BUILD_PANEL(avx, float);
|
||||
DECLARE_BUILD_PANEL(512, float);
|
||||
DECLARE_STORE_PANEL(sse, float);
|
||||
DECLARE_STORE_PANEL(avx, float);
|
||||
<<<<<<< HEAD
|
||||
>>>>>>> 7bcb460a3994dda40f24cae0044b5a36f4f16515
|
||||
=======
|
||||
DECLARE_STORE_PANEL(512, float);
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
|
||||
#endif /* SN_MATKERNEL */
|
||||
|
||||
@@ -1,52 +1,29 @@
|
||||
#include "sn_intrinsic.h"
|
||||
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
DECLARE_PNL_PROC_ANS(float, sse, clear)
|
||||
{
|
||||
register __m128 zero = _mm_setzero_ps();
|
||||
PANEL_COL_VEC((*ans), 0, 0) = zero;
|
||||
PANEL_COL_VEC((*ans), 1, 0) = zero;
|
||||
PANEL_COL_VEC((*ans), 2, 0) = zero;
|
||||
PANEL_COL_VEC((*ans), 3, 0) = zero;
|
||||
for (size_t i = 0; i < 4; i++) {
|
||||
PANEL_COL_VEC((*ans), i, 0) = zero;
|
||||
}
|
||||
}
|
||||
|
||||
DECLARE_PNL_PROC_ANS(float, avx, clear)
|
||||
{
|
||||
register __m256 zero = _mm256_setzero_ps();
|
||||
<<<<<<< HEAD
|
||||
PANEL_COL_VEC((*ans), 0, 0) = zero;
|
||||
PANEL_COL_VEC((*ans), 1, 0) = zero;
|
||||
PANEL_COL_VEC((*ans), 2, 0) = zero;
|
||||
PANEL_COL_VEC((*ans), 3, 0) = zero;
|
||||
=======
|
||||
for (size_t i = 0; i < 8; i++) {
|
||||
PANEL_COL_VEC((*ans), i, 0) = zero;
|
||||
}
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
}
|
||||
|
||||
DECLARE_PNL_PROC_ANS(float, 512, clear)
|
||||
{
|
||||
register __m512 zero = _mm512_setzero_ps();
|
||||
<<<<<<< HEAD
|
||||
PANEL_COL_VEC((*ans), 0, 0) = zero;
|
||||
PANEL_COL_VEC((*ans), 1, 0) = zero;
|
||||
PANEL_COL_VEC((*ans), 2, 0) = zero;
|
||||
PANEL_COL_VEC((*ans), 3, 0) = zero;
|
||||
}
|
||||
|
||||
=======
|
||||
>>>>>>> 7bcb460a3994dda40f24cae0044b5a36f4f16515
|
||||
=======
|
||||
for (size_t i = 0; i < 16; i++) {
|
||||
PANEL_COL_VEC((*ans), i, 0) = zero;
|
||||
}
|
||||
}
|
||||
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
|
||||
// Matrix transpose implementations
|
||||
DECLARE_KER_PROC_RIGHT_ANS(float, sse, transpose)
|
||||
{
|
||||
|
||||
@@ -54,10 +54,6 @@ DECLARE_PNL_PROC_LEFT_RIGHT_ANS(float, sse, fma)
|
||||
|
||||
// ans = left * right + ans
|
||||
// right is not transposed
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
DECLARE_PNL_PROC_LEFT_RIGHT_ANS(float, avx_fma, fma)
|
||||
{
|
||||
static const __m256i idx0 = { 1, 1, 1, 1, 1, 1, 1, 1 };
|
||||
@@ -101,11 +97,6 @@ DECLARE_PNL_PROC_LEFT_RIGHT_ANS(float, avx_fma, fma)
|
||||
|
||||
// ans = left * right + ans
|
||||
// right is not transposed
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
>>>>>>> 7bcb460a3994dda40f24cae0044b5a36f4f16515
|
||||
=======
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
DECLARE_PNL_PROC_LEFT_RIGHT_ANS(float, avx, fma)
|
||||
{
|
||||
static const __m256i idx0 = { 1, 1, 1, 1, 1, 1, 1, 1 };
|
||||
|
||||
@@ -41,18 +41,10 @@ DECLARE_BUILD_PANEL(avx, float)
|
||||
}
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
DECLARE_BUILD_PANEL(sse, float)
|
||||
{
|
||||
/* Single kernel -> 4 columns, each is one __m128 column vector. */
|
||||
const MAT_KERNEL(float) *src = matrix + (col_index * row_length + row_index);
|
||||
=======
|
||||
DECLARE_BUILD_PANEL(sse, float)
|
||||
{
|
||||
/* Single kernel -> 4 columns, each is one __m128 column vector. */
|
||||
const MAT_KERNEL(float) *src = matrix + (row_index * col_length + col_index);
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
|
||||
for (int pc = 0; pc < 4; ++pc) {
|
||||
PANEL_COL_VEC((*panel), pc, 0) = src->xmm[pc];
|
||||
@@ -62,35 +54,22 @@ DECLARE_BUILD_PANEL(sse, float)
|
||||
DECLARE_BUILD_PANEL(512, float)
|
||||
{
|
||||
const MAT_KERNEL(float) *const zero = (const MAT_KERNEL(float) *)&SN_ZERO_KERNEL;
|
||||
<<<<<<< HEAD
|
||||
const MAT_KERNEL(float) *k[4][4];
|
||||
=======
|
||||
const MAT_KERNEL(float) * k[4][4];
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
|
||||
for (int kc = 0; kc < 4; ++kc) {
|
||||
for (int kr = 0; kr < 4; ++kr) {
|
||||
const int col = col_index + kc;
|
||||
const int row = row_index + kr;
|
||||
k[kc][kr] = (col < col_length && row < row_length) ?
|
||||
<<<<<<< HEAD
|
||||
(matrix + (col * row_length + row)) :
|
||||
=======
|
||||
(matrix + (row * col_length + col)) :
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
zero;
|
||||
}
|
||||
}
|
||||
|
||||
/* Each panel column corresponds to a kernel column (0..3) within a block col (0..3). */
|
||||
for (int pc = 0; pc < 16; ++pc) {
|
||||
<<<<<<< HEAD
|
||||
const int blk_col = pc >> 2; /* which kernel column block (0..3) */
|
||||
const int kc_col = pc & 3; /* column inside a 4x4 kernel */
|
||||
=======
|
||||
const int blk_col = pc >> 2; /* which kernel column block (0..3) */
|
||||
const int kc_col = pc & 3; /* column inside a 4x4 kernel */
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
|
||||
const __m128 r0 = k[blk_col][0]->xmm[kc_col];
|
||||
const __m128 r1 = k[blk_col][1]->xmm[kc_col];
|
||||
@@ -107,11 +86,6 @@ DECLARE_BUILD_PANEL(512, float)
|
||||
}
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
>>>>>>> 7bcb460a3994dda40f24cae0044b5a36f4f16515
|
||||
=======
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
DECLARE_STORE_PANEL(avx, float)
|
||||
{
|
||||
const int Q = 8; /* fixed for AVX float panel */
|
||||
@@ -167,18 +141,10 @@ DECLARE_STORE_PANEL(avx, float)
|
||||
k_lb->xmm[kc_col] = bot128;
|
||||
}
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
|
||||
DECLARE_STORE_PANEL(sse, float)
|
||||
{
|
||||
MAT_KERNEL(float) *dst = matrix + (col_index * row_length + row_index);
|
||||
=======
|
||||
|
||||
|
||||
DECLARE_STORE_PANEL(sse, float)
|
||||
{
|
||||
MAT_KERNEL(float) *dst = matrix + (row_index * col_length + col_index);
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
|
||||
for (int pc = 0; pc < 4; ++pc) {
|
||||
const __m128 col = PANEL_COL_VEC((*panel), pc, 0);
|
||||
@@ -189,34 +155,21 @@ DECLARE_STORE_PANEL(sse, float)
|
||||
DECLARE_STORE_PANEL(512, float)
|
||||
{
|
||||
MAT_KERNEL(float) zero;
|
||||
<<<<<<< HEAD
|
||||
MAT_KERNEL(float) *k[4][4];
|
||||
=======
|
||||
MAT_KERNEL(float) * k[4][4];
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
|
||||
for (int kc = 0; kc < 4; ++kc) {
|
||||
for (int kr = 0; kr < 4; ++kr) {
|
||||
const int col = col_index + kc;
|
||||
const int row = row_index + kr;
|
||||
k[kc][kr] = (col < col_length && row < row_length) ?
|
||||
<<<<<<< HEAD
|
||||
(matrix + (col * row_length + row)) :
|
||||
=======
|
||||
(matrix + (row * col_length + col)) :
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
&zero;
|
||||
}
|
||||
}
|
||||
|
||||
for (int pc = 0; pc < 16; ++pc) {
|
||||
<<<<<<< HEAD
|
||||
const int blk_col = pc >> 2; /* which kernel column block (0..3) */
|
||||
const int kc_col = pc & 3; /* column inside a 4x4 kernel */
|
||||
=======
|
||||
const int blk_col = pc >> 2; /* which kernel column block (0..3) */
|
||||
const int kc_col = pc & 3; /* column inside a 4x4 kernel */
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
|
||||
const __m512 col = PANEL_COL_VEC((*panel), pc, 0);
|
||||
|
||||
@@ -234,8 +187,3 @@ DECLARE_STORE_PANEL(512, float)
|
||||
k[blk_col][3]->xmm[kc_col] = r3;
|
||||
}
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
>>>>>>> 7bcb460a3994dda40f24cae0044b5a36f4f16515
|
||||
=======
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
|
||||
@@ -65,23 +65,11 @@ void load_intrinsic_sse(sn_intrinsic *context)
|
||||
context->city_hash_simplify = city_hash_simplify_sse;
|
||||
context->factorial_simd = factorial_simd_sse;
|
||||
context->index_pair = index_pair_sse;
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
context->f32_clear_panel = PNL_PROC(float, sse, clear);
|
||||
context->f32_build_panel = BUILD_PANEL(sse, float);
|
||||
context->f32_buffer_add = BUF_PROC(float, sse, add);
|
||||
context->f32_panel_fma = PNL_PROC(float, sse, fma);
|
||||
=======
|
||||
context->f32_buffer_add = BUF_PROC(float, sse, add);
|
||||
context->f32_panel_fma = KER_PROC(float, sse, fma);
|
||||
>>>>>>> 7bcb460a3994dda40f24cae0044b5a36f4f16515
|
||||
=======
|
||||
context->f32_store_panel = STORE_PANEL(sse, float);
|
||||
context->f32_clear_panel = PNL_PROC(float, sse, clear);
|
||||
context->f32_build_panel = BUILD_PANEL(sse, float);
|
||||
context->f32_buffer_add = BUF_PROC(float, sse, add);
|
||||
context->f32_panel_fma = PNL_PROC(float, sse, fma);
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
context->f32_buffer_fill = BUF_PROC(float, sse, fill);
|
||||
context->variant = BUF_PROC(float, sse, scalar_mul);
|
||||
context->f32_buffer_sub = BUF_PROC(float, sse, sub);
|
||||
@@ -95,23 +83,11 @@ void load_intrinsic_avx(sn_intrinsic *context)
|
||||
context->city_hash_simplify = city_hash_simplify_sse;
|
||||
context->factorial_simd = factorial_simd_sse;
|
||||
context->index_pair = index_pair_sse;
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
context->f32_clear_panel = PNL_PROC(float, avx, clear);
|
||||
context->f32_build_panel = BUILD_PANEL(avx, float);
|
||||
context->f32_buffer_add = BUF_PROC(float, avx, add);
|
||||
context->f32_panel_fma = PNL_PROC(float, avx, fma);
|
||||
=======
|
||||
context->f32_buffer_add = BUF_PROC(float, avx, add);
|
||||
context->f32_panel_fma = KER_PROC(float, sse, fma);
|
||||
>>>>>>> 7bcb460a3994dda40f24cae0044b5a36f4f16515
|
||||
=======
|
||||
context->f32_store_panel = STORE_PANEL(avx, float);
|
||||
context->f32_clear_panel = PNL_PROC(float, avx, clear);
|
||||
context->f32_build_panel = BUILD_PANEL(avx, float);
|
||||
context->f32_buffer_add = BUF_PROC(float, avx, add);
|
||||
context->f32_panel_fma = PNL_PROC(float, avx, fma);
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
context->f32_buffer_fill = BUF_PROC(float, avx, fill);
|
||||
context->variant = BUF_PROC(float, avx, scalar_mul);
|
||||
context->f32_buffer_sub = BUF_PROC(float, avx, sub);
|
||||
@@ -125,23 +101,11 @@ void load_intrinsic_512(sn_intrinsic *context)
|
||||
context->city_hash_simplify = city_hash_simplify_sse;
|
||||
context->factorial_simd = factorial_simd_sse;
|
||||
context->index_pair = index_pair_sse;
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
context->f32_clear_panel = PNL_PROC(float, sse, clear);
|
||||
context->f32_build_panel = BUILD_PANEL(512, float);
|
||||
context->f32_buffer_add = BUF_PROC(float, 512, add);
|
||||
context->f32_panel_fma = PNL_PROC(float, 512, fma);
|
||||
=======
|
||||
context->f32_buffer_add = BUF_PROC(float, 512, add);
|
||||
context->f32_panel_fma = KER_PROC(float, sse, fma);
|
||||
>>>>>>> 7bcb460a3994dda40f24cae0044b5a36f4f16515
|
||||
=======
|
||||
context->f32_store_panel = STORE_PANEL(512, float);
|
||||
context->f32_clear_panel = PNL_PROC(float, 512, clear);
|
||||
context->f32_build_panel = BUILD_PANEL(512, float);
|
||||
context->f32_buffer_add = BUF_PROC(float, 512, add);
|
||||
context->f32_panel_fma = PNL_PROC(float, 512, fma);
|
||||
>>>>>>> stgsharp-dev/giga
|
||||
context->f32_buffer_fill = BUF_PROC(float, 512, fill);
|
||||
context->variant = BUF_PROC(float, 512, scalar_mul);
|
||||
context->f32_buffer_sub = BUF_PROC(float, 512, sub);
|
||||
|
||||
Reference in New Issue
Block a user