Skip to content

Comments

fix Issue 16958 - replace -mavx switch with -mcpu=id#6306

Merged
andralex merged 1 commit intodlang:masterfrom
WalterBright:mcpu
Dec 12, 2016
Merged

fix Issue 16958 - replace -mavx switch with -mcpu=id#6306
andralex merged 1 commit intodlang:masterfrom
WalterBright:mcpu

Conversation

@WalterBright
Copy link
Member

@WalterBright WalterBright commented Dec 8, 2016

The -mcpu=native will allow the autotester to randomly check the AVX code generation, since only some of the machines are AVX capable, and are randomly assigned.

@dlang-bot
Copy link
Contributor

Fix Bugzilla Description
16958 replace -mavx switch with -mcpu=id

src/mars.d Outdated
else
goto Lerror;
}
else if (memcmp(p + 1, cast(char*)"mcpu", 4) == 0)
Copy link
Member

Choose a reason for hiding this comment

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

memcmp(p + 1, "mcpu".ptr, 4)

Copy link
Member Author

Choose a reason for hiding this comment

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

good

");
exit(EXIT_SUCCESS);
}
else if (Identifier.isValidIdentifier(p + 6))
Copy link
Member

Choose a reason for hiding this comment

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

This API is awkward - first it tells you whether an identifier is valid, than you need to do the same work again to load it. How about parseCPUType that returns an enum value?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a copy/paste bit of code from the "-transition=id" block. Splitting out the parser would wind up being even more lines of code, since it's a one-off job. Of course, at some point we should just migrate the whole shebang to std.getopt, but I don't think it is worthwhile to badly reinvent std.getopt in the meantime.

@andralex
Copy link
Member

Auto-merge toggled on

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