daily update on 20250208 by nitload youmu. lexical analyzer complete but little problem
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#include "StgSharpC.h"
|
||||
#include "gl.h"
|
||||
#include "glfw3.h"
|
||||
#include "ssc_framework.h"
|
||||
#include <stdio.h>
|
||||
|
||||
GladGLContext *currentContext;
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#ifndef SSC
|
||||
#define SSC
|
||||
|
||||
#include "ssc_framework.h"
|
||||
#include "ssc_internal.h"
|
||||
|
||||
#define STBIDEF SSCAPI
|
||||
|
||||
@@ -181,7 +181,6 @@
|
||||
<ClInclude Include="glfw3native.h" />
|
||||
<ClInclude Include="ssc_intrinsic.h" />
|
||||
<ClInclude Include="khrplatform.h" />
|
||||
<ClInclude Include="ssc_framework.h" />
|
||||
<ClInclude Include="ssc_internal.h" />
|
||||
<ClInclude Include="stb_image.h" />
|
||||
<ClInclude Include="StgSharpC.h" />
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "ssc_framework.h"
|
||||
#endif // __
|
||||
|
||||
#include "StgSharpC.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#include "ssc_intrinsic.h"
|
||||
#include "StgSharpC.h"
|
||||
|
||||
static inline uint32_t fmix32(uint32_t hash);
|
||||
|
||||
INTERNAL int SSCDECL city_hash_simplify_sse(byte const *str, int const length)
|
||||
{
|
||||
uint32_t hash = length, size = length << 1;
|
||||
@@ -42,5 +40,5 @@ INTERNAL int SSCDECL city_hash_simplify_sse(byte const *str, int const length)
|
||||
hash ^= hash >> 13;
|
||||
hash *= 0xc2b2ae35;
|
||||
hash ^= hash >> 16;
|
||||
return fmix32(hash);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ INTERNAL void SSCDECL dot_43_512(__4_columnset *transpose, __m128 *vector, __m12
|
||||
#pragma region string
|
||||
|
||||
INTERNAL int SSCDECL city_hash_simplify_sse(byte const *str, int length);
|
||||
INTERNAL int SSCDECL index_pair_sse(byte const *str, uint32_t target, int length);
|
||||
INTERNAL int SSCDECL index_pair_sse(short const *str, uint32_t target, int length);
|
||||
|
||||
#pragma endregion
|
||||
|
||||
@@ -122,7 +122,7 @@ typedef struct ssc_intrinsic {
|
||||
DOTPROC dot_41;
|
||||
DOTPROC dot_42;
|
||||
DOTPROC dot_43;
|
||||
int (*index_pair)(byte *str, byte *target, int length, int start);
|
||||
int (*index_pair)(short const *str, uint32_t target, int length);
|
||||
VECTORNORMALIZEPROC normalize_3;
|
||||
MATRIXTRANSPOSEPROC transpose_23;
|
||||
MATRIXTRANSPOSEPROC transpose_24;
|
||||
|
||||
+35
-12
@@ -1,27 +1,50 @@
|
||||
#include "StgSharpC.h"
|
||||
#include "ssc_intrinsic.h"
|
||||
|
||||
int index_pair_sse(byte const *str, uint32_t target, int length)
|
||||
int index_pair_sse(short const *str, uint32_t target, int length)
|
||||
{
|
||||
int index = 0, result = 0, size = length << 1, end = size - 14;
|
||||
__m128i source = { .m128i_i32 = {
|
||||
int index = 0, result = 0, size = length, end = size - 8;
|
||||
__m128i s_even = { .m128i_u32 = {
|
||||
target,
|
||||
target,
|
||||
target,
|
||||
target,
|
||||
} };
|
||||
for (; (index < end) && (!result); index += 14) { // move 7*2 bytes instead of 8*2
|
||||
__m128i vec = _mm_loadu_epi32(str + index);
|
||||
__m128i com = _mm_cmpeq_epi32(vec, source);
|
||||
__m128i vec, com;
|
||||
|
||||
while (index < end) {
|
||||
vec = _mm_loadu_epi32(str + index);
|
||||
com = _mm_cmpeq_epi16(vec, s_even);
|
||||
result = _mm_movemask_epi8(com);
|
||||
}
|
||||
if (result) {
|
||||
for (; result; result >> 2) {
|
||||
index++;
|
||||
if (result) {
|
||||
for (size_t i = 0; i < 12; i++) {
|
||||
result >>= 2;
|
||||
if (((result & 0xF) == 0xF)) {
|
||||
return index + i;
|
||||
}
|
||||
if (result == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return index;
|
||||
index += 1;
|
||||
vec = _mm_loadu_epi32(str + index);
|
||||
com = _mm_cmpeq_epi16(vec, s_even);
|
||||
result = _mm_movemask_epi8(com);
|
||||
if (result) {
|
||||
for (size_t i = 0; i < 12; i++) {
|
||||
result >>= 2;
|
||||
if (((result & 0xF) == 0xF)) {
|
||||
return index + i;
|
||||
}
|
||||
if (result == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
index += 7;
|
||||
}
|
||||
for (; (index < size - 2) && (!result); index += 2) {
|
||||
for (; (index < size - 1) && (!result); index += 2) {
|
||||
result = *(int *)(str + index) == target;
|
||||
}
|
||||
if (result) {
|
||||
|
||||
Reference in New Issue
Block a user