Skip to content

Add --x86-64-v2 and similar to configure - #1092

Merged
mflatt merged 1 commit into
cisco:mainfrom
mflatt:x86-64-v2
Nov 6, 2026
Merged

mflatt merged 1 commit into
cisco:mainfrom
mflatt:x86-64-v2

Conversation

@mflatt

@mflatt mflatt commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

This is a follow-up to #1088, so it's a candidate for merging only after that PR, and only the most recent commit here is intended for the PR.

Add a --x86-64-v<level> option to configure to control code generation for x86_64 extensions. The allowed <level>s are 1 through 4. The configure flag is meant to be reminiscent of -march=x86-64-v2 as a compiler flag, and the intent is to follow the meaning of levels 1 through 4 in the x86-64 psABI. For build.bat, the flag is /x86-64-v<level>.

Using <level> as 2 causes POPCOUNT and SSE4.1 rounding instructions to be used directly in generated code, instead of added by linking only when available at run time (which imposes a small cost compared to directly using an instruction). A future change might use <level> as 3 to enable the FMA instruction.

It could make sense for --x86-64-v2 to be a different machine type, instead of a option controlling a6 (i.e., x86_64) targets. Making it a configuration choice within a6 is less disruptive and seems more consistent with the way these kinds of architecture specializations are usually selected.

Note that using --x86-64-v2 can make sense when using configure for a non-x86_64 platform if something like make ta6le.boot is going to be used to generate boot files. (Most of the work in this PR was getting the build dependencies straight so that reconfiguring with a different level does that right thing in both cross and non-cross build modes.)

@samth

samth commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

This commit extends the approach here for flfma: 8f6a290

Valid levels are 1, 2, 3, and 4, but only 1 versus 2 and up matters
currently. Confoguring for level 1 means that POPCOUNT and SSE4.1
instructions are used directly instead of linked dynamically when
available.
@mflatt
mflatt merged commit 68a0bc5 into cisco:main Nov 6, 2026
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.

2 participants