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

Add "not" optimization. #165

Merged
merged 1 commit into from Dec 20, 2017
Merged

Add "not" optimization. #165

merged 1 commit into from Dec 20, 2017

Conversation

Kailo97
Copy link
Contributor

@Kailo97 Kailo97 commented Dec 19, 2017

if (!func())

Gives

not
jzer n

It has to replace to

jnz n

@asherkin
Copy link
Member

@asherkin asherkin commented Dec 20, 2017

This lgtm (being a lift from upstream), but I'd like @Fyren or @dvander to give this a once over before merging as they're more familiar with this beast and our changes to it.

@Kailo97
Copy link
Contributor Author

@Kailo97 Kailo97 commented Dec 20, 2017

About this case (probably not generatable)

eq.c.pri 0
not
jzer n1

all still worse

if (!(g_int[0] == 0))

gives

const.pri 2228
load.i
zero.alt
eq
not
jzer 3292

@dvander
Copy link
Member

@dvander dvander commented Dec 20, 2017

This seems reasonable.

@dvander dvander merged commit c7bc519 into alliedmodders:master Dec 20, 2017
2 checks passed
@Kailo97 Kailo97 deleted the patch-1 branch Dec 20, 2017
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.

None yet

3 participants