From 43039ef5c0475fa39b6c443000afd868c27c9168 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 3 Jan 2018 16:02:35 -0800 Subject: [PATCH] Add an exception for vzeroall/vzeroupper on Windows These apparently blow the 20 intstruction limit with all the loads/stores. --- stdsimd-test/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/stdsimd-test/src/lib.rs b/stdsimd-test/src/lib.rs index ccd5bb58e7..d41bec2564 100644 --- a/stdsimd-test/src/lib.rs +++ b/stdsimd-test/src/lib.rs @@ -327,6 +327,13 @@ pub fn assert(fnptr: usize, fnname: &str, expected: &str) { // cpuid returns a pretty big aggregate structure so excempt it from the // slightly more restrictive 20 instructions below "cpuid" => 30, + + // Apparently on Windows LLVM generates a bunch of saves/restores of xmm + // registers around these intstructions which blows the 20 limit + // below. As it seems dictates by Windows's abi (I guess?) we probably + // can't do much about it... + "vzeroall" | "vzeroupper" if cfg!(windows) => 30, + _ => 20, }; let probably_only_one_instruction =