cpu: lower 34 packed, scalar, and half-precision float conversion instructions (SSE, SSE2, AVX) #735
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/741"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by MrSkelee on 2026-11-23T00:14:42Z.
Lowers 34 Zen 2 float, double, integer, and F16C conversion instructions across SSE, SSE2, and AVX (VEX.128) encodings with full native differential coverage.
Highlights
cvtdq2ps,vcvtdq2ps,cvtdq2pd,vcvtdq2pd,cvtps2dq,vcvtps2dq,cvttps2dq,vcvttps2dq,cvtps2pd,vcvtps2pd,cvtpd2ps,vcvtpd2ps,cvtpd2dq,vcvtpd2dq,cvttpd2dq,vcvttpd2dqcvtss2sd,vcvtss2sd,cvtsd2ss,vcvtsd2sscvtsi2ss,vcvtsi2ss,cvtsi2sd,vcvtsi2sdcvtss2si,vcvtss2si,cvttss2si,vcvttss2si,cvtsd2si,vcvtsd2si,cvttsd2si,vcvttsd2sivcvtph2ps,vcvtps2phValueErrorbefore register indexing.dev(/Od) andrelease(/O2) presets.Verification
Local results: 354/354 operations passed (0 failures).
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T01:14:03Z.
Review: COMMENTED
Re-reviewed
2f4d918. The native AVX harness checks OS-enabled XMM/YMM state, F16C is gated separately, and VCVTPS2PH rejects immediates other than zero. Immediate 0 specifies round-to-nearest-even directly. The encoding that selects MXCSR is outside this profile. Both Windows jobs and Linux passed at this SHA. My requested changes are satisfied.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T00:30:44Z.
The decoded-operand checks cover the intended register forms. Two verification gaps remain. The test harness itself uses YMM instructions to seed and read the upper half, so check AVX plus OS-enabled XMM/YMM state before calling it. Gate the F16C exports separately so AVX-capable hosts without F16C still test the other conversions.
VCVTPS2PHcurrently accepts every decoded immediate, but its native fixture exercises only immediate 0. Please limit the first profile to that rounding form or demonstrate the directed and MXCSR-controlled forms with a halfway input that distinguishes them.Imported from R0Y00/Xbox2Windows. Originally posted by MrSkelee on 2026-11-23T00:45:10Z.
Updated in
2f4d918:host_has_avx()verifying CPUID leaf 1 ECX bit 28, OSXSAVE bit 27, and_xgetbv(0) & 6ull == 6ull, returning CTest skip code 77 if unavailable.host_has_f16c()check (CPUID leaf 1 ECX bit 29) to gatevcvtph2ps_opandvcvtps2ph_opso AVX hosts lacking F16C still execute and verify the other 44 conversions.vcvtps2phtoimmediate8 == 0(MXCSR rounding), rejecting non-zero rounding mode immediates withValueError.vcvtps2ph xmm0, xmm1, 1(c4 e3 79 1d c8 01).dev(/Od) andrelease(/O2) presets.