Skip to content

Commit e7794c0

Browse files
committed
arch: Replace Tesseract data types by POSIX data types
Signed-off-by: Stefan Weil <[email protected]>
1 parent c1d649e commit e7794c0

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

arch/dotproductavx.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ double DotProductAVX(const double* u, const double* v, int n) {
9090
// instruction, as that introduces a 70 cycle delay. All this casting is to
9191
// fool the intrinsics into thinking we are extracting the bottom int64.
9292
auto cast_sum = _mm256_castpd_si256(sum);
93-
*(reinterpret_cast<inT64*>(&result)) =
93+
*(reinterpret_cast<int64_t*>(&result)) =
9494
#if defined(_WIN32) || defined(__i386__)
9595
// This is a very simple workaround that is activated
9696
// for all platforms that do not have _mm256_extract_epi64.

arch/dotproductsse.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ double DotProductSSE(const double* u, const double* v, int n) {
2828
fprintf(stderr, "DotProductSSE can't be used on Android\n");
2929
abort();
3030
}
31-
inT32 IntDotProductSSE(const inT8* u, const inT8* v, int n) {
31+
int32_t IntDotProductSSE(const int8_t* u, const int8_t* v, int n) {
3232
fprintf(stderr, "IntDotProductSSE can't be used on Android\n");
3333
abort();
3434
}
@@ -99,7 +99,7 @@ double DotProductSSE(const double* u, const double* v, int n) {
9999

100100
// Computes and returns the dot product of the n-vectors u and v.
101101
// Uses Intel SSE intrinsics to access the SIMD instruction set.
102-
inT32 IntDotProductSSE(const inT8* u, const inT8* v, int n) {
102+
int32_t IntDotProductSSE(const int8_t* u, const int8_t* v, int n) {
103103
int max_offset = n - 8;
104104
int offset = 0;
105105
// Accumulate a set of 4 32-bit sums in sum, by loading 8 pairs of 8-bit
@@ -128,7 +128,7 @@ inT32 IntDotProductSSE(const inT8* u, const inT8* v, int n) {
128128
// Sum the 4 packed 32 bit sums and extract the low result.
129129
sum = _mm_hadd_epi32(sum, sum);
130130
sum = _mm_hadd_epi32(sum, sum);
131-
inT32 result = _mm_cvtsi128_si32(sum);
131+
int32_t result = _mm_cvtsi128_si32(sum);
132132
while (offset < n) {
133133
result += u[offset] * v[offset];
134134
++offset;

arch/dotproductsse.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace tesseract {
2828
double DotProductSSE(const double* u, const double* v, int n);
2929
// Computes and returns the dot product of the n-vectors u and v.
3030
// Uses Intel SSE intrinsics to access the SIMD instruction set.
31-
inT32 IntDotProductSSE(const inT8* u, const inT8* v, int n);
31+
int32_t IntDotProductSSE(const int8_t* u, const int8_t* v, int n);
3232

3333
} // namespace tesseract.
3434

0 commit comments

Comments
 (0)