Skip to content

Remove tzcnt from audited BMI1 instructions #1380

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

Merged
merged 2 commits into from
May 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions contrib/generate_instructions_list.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ function generate_dict()
end
end
end
if name == "bmi1"
# `tzcnt` can be legally emitted by compilers in some cases even when
# the BMI1 feature is not available, so do not audit it.
#
# see: https://stackoverflow.com/questions/61422827/does-x64-support-imply-bmi1-support
deleteat!(instructions, findfirst(==("tzcnt"), instructions))
end
dict[name] = instructions
end
free(xml)
Expand Down
112 changes: 108 additions & 4 deletions src/auditor/instructions.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@
"pmulld",
"popcnt",
"ptest",
"rex crc32",
"roundpd",
"roundps",
"roundsd",
Expand Down Expand Up @@ -301,6 +300,8 @@
"v4fmaddss",
"v4fnmaddps",
"v4fnmaddss",
"vaddph",
"vaddsh",
"vaesdec",
"vaesdeclast",
"vaesenc",
Expand All @@ -319,35 +320,72 @@
"vbroadcasti32x8",
"vbroadcasti64x2",
"vbroadcasti64x4",
"vcmpph",
"vcmpsh",
"vcomish",
"vcompresspd",
"vcompressps",
"vcvtdq2ph",
"vcvtne2ps2bf16",
"vcvtneps2bf16",
"vcvtpd2ph",
"vcvtpd2qq",
"vcvtpd2udq",
"vcvtpd2uqq",
"vcvtph2dq",
"vcvtph2pd",
"vcvtph2psx",
"vcvtph2qq",
"vcvtph2udq",
"vcvtph2uqq",
"vcvtph2uw",
"vcvtph2w",
"vcvtps2phx",
"vcvtps2qq",
"vcvtps2udq",
"vcvtps2uqq",
"vcvtqq2pd",
"vcvtqq2ph",
"vcvtqq2ps",
"vcvtsd2sh",
"vcvtsd2usi",
"vcvtsh2sd",
"vcvtsh2si",
"vcvtsh2ss",
"vcvtsh2usi",
"vcvtsi2sh",
"vcvtss2sh",
"vcvtss2usi",
"vcvttpd2qq",
"vcvttpd2udq",
"vcvttpd2uqq",
"vcvttph2dq",
"vcvttph2qq",
"vcvttph2udq",
"vcvttph2uqq",
"vcvttph2uw",
"vcvttph2w",
"vcvttps2qq",
"vcvttps2udq",
"vcvttps2uqq",
"vcvttsd2usi",
"vcvttsh2si",
"vcvttsh2usi",
"vcvttss2usi",
"vcvtudq2pd",
"vcvtudq2ph",
"vcvtudq2ps",
"vcvtuqq2pd",
"vcvtuqq2ph",
"vcvtuqq2ps",
"vcvtusi2sd",
"vcvtusi2sh",
"vcvtusi2ss",
"vcvtuw2ph",
"vcvtw2ph",
"vdbpsadbw",
"vdivph",
"vdivsh",
"vdpbf16ps",
"vexp2pd",
"vexp2ps",
Expand All @@ -361,13 +399,53 @@
"vextracti32x8",
"vextracti64x2",
"vextracti64x4",
"vfcmaddcph",
"vfcmaddcsh",
"vfcmulcph",
"vfcmulcsh",
"vfixupimmpd",
"vfixupimmps",
"vfixupimmsd",
"vfixupimmss",
"vfmadd132ph",
"vfmadd132sh",
"vfmadd213ph",
"vfmadd213sh",
"vfmadd231ph",
"vfmadd231sh",
"vfmaddcph",
"vfmaddcsh",
"vfmaddsub132ph",
"vfmaddsub213ph",
"vfmaddsub231ph",
"vfmsub132ph",
"vfmsub132sh",
"vfmsub213ph",
"vfmsub213sh",
"vfmsub231ph",
"vfmsub231sh",
"vfmsubadd132ph",
"vfmsubadd213ph",
"vfmsubadd231ph",
"vfmulcph",
"vfmulcsh",
"vfnmadd132ph",
"vfnmadd132sh",
"vfnmadd213ph",
"vfnmadd213sh",
"vfnmadd231ph",
"vfnmadd231sh",
"vfnmsub132ph",
"vfnmsub132sh",
"vfnmsub213ph",
"vfnmsub213sh",
"vfnmsub231ph",
"vfnmsub231sh",
"vfpclasspd",
"vfpclassph",
"vfpclassps",
"vfpclasssd",
"vfpclasssh",
"vfpclassss",
"vgatherdpd",
"vgatherdps",
Expand All @@ -382,12 +460,16 @@
"vgatherqpd",
"vgatherqps",
"vgetexppd",
"vgetexpph",
"vgetexpps",
"vgetexpsd",
"vgetexpsh",
"vgetexpss",
"vgetmantpd",
"vgetmantph",
"vgetmantps",
"vgetmantsd",
"vgetmantsh",
"vgetmantss",
"vgf2p8affineinvqb",
"vgf2p8affineqb",
Expand All @@ -400,12 +482,20 @@
"vinserti32x8",
"vinserti64x2",
"vinserti64x4",
"vmaxph",
"vmaxsh",
"vminph",
"vminsh",
"vmovdqa32",
"vmovdqa64",
"vmovdqu16",
"vmovdqu32",
"vmovdqu64",
"vmovdqu8",
"vmovsh",
"vmovw",
"vmulph",
"vmulsh",
"vp2intersectd",
"vp2intersectq",
"vp4dpwssd",
Expand Down Expand Up @@ -557,13 +647,19 @@
"vrcp28ps",
"vrcp28sd",
"vrcp28ss",
"vrcpph",
"vrcpsh",
"vreducepd",
"vreduceph",
"vreduceps",
"vreducesd",
"vreducesh",
"vreducess",
"vrndscalepd",
"vrndscaleph",
"vrndscaleps",
"vrndscalesd",
"vrndscalesh",
"vrndscaless",
"vrsqrt14pd",
"vrsqrt14ps",
Expand All @@ -573,9 +669,13 @@
"vrsqrt28ps",
"vrsqrt28sd",
"vrsqrt28ss",
"vrsqrtph",
"vrsqrtsh",
"vscalefpd",
"vscalefph",
"vscalefps",
"vscalefsd",
"vscalefsh",
"vscalefss",
"vscatterdpd",
"vscatterdps",
Expand All @@ -592,7 +692,12 @@
"vshuff32x4",
"vshuff64x2",
"vshufi32x4",
"vshufi64x2"
"vshufi64x2",
"vsqrtph",
"vsqrtsh",
"vsubph",
"vsubsh",
"vucomish"
],
"f16c": [
"vcvtph2ps",
Expand Down Expand Up @@ -1035,8 +1140,7 @@
"bextr",
"blsi",
"blsmsk",
"blsr",
"tzcnt"
"blsr"
],
"adcx": []
}
Loading