Closed mr-c closed 1 year ago
cc @tlively - was there some recent LLVM change to SIMD?
FYI: this particular code path does not have any SIMD intrinsics, but many compilers might convert the vector operation to SIMD ops
I'm not aware of any relevant LLVM changes, but there must be a codegen regression. I'm working on reproducing and bisecting now.
@mr-c I'm having trouble reproducing the problem at all. Here's my attempt to extract what the test is doing:
#include <assert.h>
#include <math.h>
#include <stdio.h>
typedef long long __i64x2 __attribute__((__vector_size__(16), __aligned__(16)));
typedef double __f64x2 __attribute__((__vector_size__(16), __aligned__(16)));
__attribute__((__noinline__))
void test(__f64x2 a, __f64x2 b) {
__i64x2 m = a < b;
__f64x2 r = (__f64x2)((((__i64x2)a) & m) | (((__i64x2)b) & ~m));
assert(m[0] == 0);
assert(m[1] == 0);
assert(r[0] == -760.30);
assert(isnan(r[1]));
}
int main() {
__f64x2 a = {NAN, 532.24};
__f64x2 b = {-760.30, NAN};
test(a, b);
printf("ok\n");
}
I would have expected this to fail with tot
, but it doesn't. @mr-c, do you think you could take a stab at extracting a smaller reproducer?
@tlively Here is the a
, b
, and expected return value that cause the failure
Some of the relevant typedefs:
typedef float simde_float32
typedef simde_float32 simde__m128 __attribute__((__aligned__((16)))) __attribute__((__vector_size__(16))) __attribute__((__may_alias__));
I'm not able to reproduce using those values either. Can you either provide a minimal reproducer or instructions for how to reproduce this with a checkout of SIMDE?
@tlively
Thanks for your persistence. Here's a recipe
git checkout https://github.com/simd-everywhere/simde.git
cd simde
mkdir -p build
meson --cross-file=docker/cross-files/emscripten.cross setup build
# you may need to edit emscripten.cross to use your local paths
meson test -C build x86/sse/emul/c x86/sse/emul/cpp wasm_simd128/pmax/emul/c wasm_simd128/pmax/emul/cpp
Thanks, I was able to reproduce the error with that recipe and I have a bisection running now. I still may need help getting a minimal reproducer for an upstream bug report, but let's see what the bad LLVM commit is first.
Looks like this was the bad commit: https://reviews.llvm.org/D143581. I've left a comment, but I don't think we'll need a minimal repro because the problem is fairly obvious.
That's great news, thanks! Do you have enough information to create a test case to prevent a future regression?
I had swapped the 'true' and 'false' result values in my patch... hopefully this is the fix...
Hello, CI for https://github.com/simd-everywhere/simde against tot got a regression
The function at the heart of the now-failing test is , but without
SIMDE_WASM_SIMD128_NATIVE
defined, https://github.com/simd-everywhere/simde/blob/7e70d02dda84bdfb1e97777bdb9622f3f29682b4/simde/x86/sse.h#L2966Here is that function from he
-E
postprocess outputVersion of emscripten/emsdk: Please include the output
emcc -v
hereworking tot: sdk-releases-c41ee404c571c6a46e1ccde357a03072706555a5-64bit https://github.com/simd-everywhere/simde/actions/runs/4155968543/jobs/7189425976
broken tot: sdk-releases-51d9739bc0b3221501654ff6a14e76b90e3dd935-64bit https://github.com/simd-everywhere/simde/actions/runs/4183801504/jobs/7248626128
Full link command and output with
-v
appended:Contents of
/tmp/emscripten_temp/
regression.tar.gz