Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External modes test and minor optimization #5480

Merged
merged 2 commits into from
May 18, 2024

Conversation

solardiz
Copy link
Member

This tests almost all external modes on make check, which we run on CI.

This also adds proper compile-time handling of negative integer constants, which previously emitted the unary - instruction. Unfortunately, the code for this is a hack. It was cleaner not to handle this case specially.

My additional test case (not included here) for this optimization is:

[List.External:Test]
void generate()
{
	if (word[2] == 666) {
		word = 0;
		return;
	}
	word[0] =-1 + 'a' + 1 - -111 -111 - 222 + 222 -111-111+222;
	word[0] -=-22;
	word[0] -= 22;
	word[0]-=-22;
	word[0]-=22;
	word[1] = -1 + 1;
	word[2] = 666;
}

This has a mix of - in different meanings, which the compiler has to distinguish properly. The expected output is a.

@solardiz
Copy link
Member Author

This also adds proper compile-time handling of negative integer constants, which previously emitted the unary - instruction. Unfortunately, the code for this is a hack. It was cleaner not to handle this case specially.

We should be able to drop this hack later with no performance loss if we instead implement generic compile-time evaluation of constant subexpressions.

@solardiz solardiz merged commit f84f518 into openwall:bleeding-jumbo May 18, 2024
31 of 32 checks passed
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.

1 participant