Merge pull request #109 from uploadcare/simd/fix-builds

Simd/fix builds
This commit is contained in:
Alexander Karpinsky 2022-01-04 19:05:54 +03:00 committed by GitHub
commit abd6708434
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 61 deletions

View File

@ -1,49 +0,0 @@
name: CIFuzz
on:
push:
paths:
- "**.c"
- "**.h"
pull_request:
paths:
- "**.c"
- "**.h"
workflow_dispatch:
jobs:
Fuzzing:
runs-on: ubuntu-latest
steps:
- name: Build Fuzzers
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: 'pillow'
language: python
dry-run: false
- name: Run Fuzzers
id: run
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
oss-fuzz-project-name: 'pillow'
fuzz-seconds: 600
language: python
dry-run: false
- name: Upload New Crash
uses: actions/upload-artifact@v2
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
path: ./out/artifacts
- name: Upload Legacy Crash
uses: actions/upload-artifact@v2
if: steps.run.outcome == 'success'
with:
name: crash
path: ./out/crash*
- name: Fail on legacy crash
if: success()
run: |
[ ! -e out/crash-* ]
echo No legacy crash detected

View File

@ -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,
@ -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 }}

View File

@ -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);

View File

@ -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
@ -25,3 +30,5 @@ mm256_cvtepu8_epi32(void *ptr) {
return _mm256_cvtepu8_epi32(_mm_loadl_epi64((__m128i *) ptr));
}
#endif
#endif