Skip to content

Add "not" optimization. - #165

Merged
dvander merged 1 commit into
alliedmodders:masterfrom
Kailo97:patch-1
Dec 20, 2017
Merged

Add "not" optimization.#165
dvander merged 1 commit into
alliedmodders:masterfrom
Kailo97:patch-1

Conversation

@Kailo97

@Kailo97 Kailo97 commented Dec 19, 2017

Copy link
Copy Markdown
Contributor
if (!func())

Gives

not
jzer n

It has to replace to

jnz n

@asherkin

Copy link
Copy Markdown
Member

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

Kailo97 commented Dec 20, 2017

Copy link
Copy Markdown
Contributor Author

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

dvander commented Dec 20, 2017

Copy link
Copy Markdown
Member

This seems reasonable.

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

3 participants