Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Nov 8, 2024

Turns out we were relying on the explicit llvm bounds check here to give use the defined SSE behavior, but normal C semantics don't give us that so we need explicit bounds checks here.

Fixes #22892

@sbc100 sbc100 requested a review from dschuff November 8, 2024 23:02
@sbc100 sbc100 force-pushed the nontrapping_sse branch 2 times, most recently from ffd4ddf to 5003169 Compare November 8, 2024 23:24
@no_asan('local count too large')
def test_sse2(self):
@parameterized({
'': ([],),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's make this an explicit `-mno-nontrapping-fptoint' so that when we flip the default, it will still be testing the same case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe better to explicitly change these tests when we make that change, since the variant will want to be renamed so the default is still empty string and the non-default becomes perhaps -trapping? Or -no-nontrapping?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or we could just name both variants I guess.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm kind keen on the idea of always having an unnamed variant for the default. Then there is always a test you can run that matches the name of the test in python. i.e. if I see def test_foo_bar i know I can run a test called test_foo_bar without any suffix. Maybe no a necessarily things, but it seems nice to have.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have other tests here like test_fasta_nontrapping that will need to be inverted when we change the default.

@no_ubsan('test contains UB')
def test_sse1(self):
@parameterized({
'': ([],),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here (same as below)

Turns out we were relying on the explicit llvm bounds check here to
give use the defined SSE behavior, but normal C semantics don't give
us that so we need explicit bounds checks here.
Copy link
Member

@dschuff dschuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine either way.
There does still seem to be a fair amount of opportunity to optimize in here. But I guess there are also plenty of //TODO: optimize so no change :)

@sbc100 sbc100 enabled auto-merge (squash) November 8, 2024 23:49
@sbc100 sbc100 disabled auto-merge November 9, 2024 00:31
@sbc100 sbc100 merged commit e6ed9d3 into emscripten-core:main Nov 9, 2024
24 of 28 checks passed
@sbc100 sbc100 deleted the nontrapping_sse branch November 9, 2024 00:32
sbc100 added a commit to sbc100/emscripten that referenced this pull request Nov 12, 2024
sbc100 added a commit to sbc100/emscripten that referenced this pull request Nov 12, 2024
sbc100 added a commit to sbc100/emscripten that referenced this pull request Nov 12, 2024
sbc100 added a commit to sbc100/emscripten that referenced this pull request Nov 12, 2024
dschuff pushed a commit that referenced this pull request Nov 12, 2024
uysalibov pushed a commit to uysalibov/emscripten that referenced this pull request Nov 15, 2024
Turns out we were relying on the explicit llvm bounds check here to give
use the defined SSE behavior, but normal C semantics don't give us that
so we need explicit bounds checks here.

Fixes emscripten-core#22892
uysalibov pushed a commit to uysalibov/emscripten that referenced this pull request Nov 15, 2024
dschuff added a commit that referenced this pull request Nov 15, 2024
Fixes lto2.test_sse1 and test_sse2 with checks similar to #22911 and
#22893
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_sse1 fails with -mnontrapping-fptoint

2 participants