Skip to content

Commit

Permalink
Merge pull request #109 from uploadcare/simd/fix-builds
Browse files Browse the repository at this point in the history
Simd/fix builds
  • Loading branch information
homm committed Jan 4, 2022
2 parents da01a5f + b5f03c9 commit abd6708
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 61 deletions.
49 changes: 0 additions & 49 deletions .github/workflows/cifuzz.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/workflows/test-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ jobs:
fail-fast: false
matrix:
docker: [
# Run slower jobs first to give them a headstart and reduce waiting time
ubuntu-20.04-focal-arm64v8,
ubuntu-20.04-focal-ppc64le,
ubuntu-20.04-focal-s390x,
# Then run the remainder
alpine,
amazon-2-amd64,
Expand All @@ -28,13 +24,6 @@ jobs:
ubuntu-20.04-focal-amd64,
]
dockerTag: [main]
include:
- docker: "ubuntu-20.04-focal-arm64v8"
qemu-arch: "aarch64"
- docker: "ubuntu-20.04-focal-ppc64le"
qemu-arch: "ppc64le"
- docker: "ubuntu-20.04-focal-s390x"
qemu-arch: "s390x"

name: ${{ matrix.docker }}

Expand Down
2 changes: 1 addition & 1 deletion src/_imaging.c
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ _prepare_lut_table(PyObject *table, Py_ssize_t table_size) {
}

/* malloc check ok, max is 2 * 4 * 65**3 = 2197000 */
prepared = (INT16 *)malloc(sizeof(INT16) * table_size + 2);
prepared = (INT16 *)malloc(sizeof(INT16) * (table_size + 2));
if (!prepared) {
if (free_table_data) {
free(table_data);
Expand Down
7 changes: 7 additions & 0 deletions src/libImaging/ImagingSIMD.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
#ifndef __IMAGING_SIMD_H__
#define __IMAGING_SIMD_H__

/* Microsoft compiler doesn't limit intrinsics for an architecture.
This macro is set only on x86 and means SSE2 and above including AVX2. */
#if defined(_M_X64) || _M_IX86_FP == 2
#define __SSE4_2__
#endif

#if defined(__SSE4_2__)
#include <emmintrin.h>
#include <mmintrin.h>
#include <smmintrin.h>
#endif

#if defined(__AVX2__)
#include <immintrin.h>
#endif
Expand All @@ -25,3 +30,5 @@ mm256_cvtepu8_epi32(void *ptr) {
return _mm256_cvtepu8_epi32(_mm_loadl_epi64((__m128i *) ptr));
}
#endif

#endif

0 comments on commit abd6708

Please sign in to comment.