Skip to contentSkip to conversation

x86emul/test: improve failure location identification for FMA sub-test

PATCH In review Jan Beulich 2 participants 2 messages Jun 14, 2022 – Jun 16, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86emul/test: improve failure location identification for FMA sub-test

When some FMA set of insns is included in the base instruction set (XOP, AVX512F, and AVX512-FP16 at present), simd_test() simply invokes fma_test(), negating its return value. In case of a failure this would yield a value close to 4G, which doesn't lend itself to easy identification of the failing test case. Recognize the case in simd_check_regs() and emit alternative output identifying FMA.

tools/tests/x86_emulator/test_x86_emulator.c +4 -1
@@ -259,7 +259,10 @@ static bool simd_check_regs(const struct
 {
     if ( !regs->eax )
         return true;
-    printf("[line %u] ", (unsigned int)regs->eax);
+    if ( (int)regs->eax > 0 )
+        printf("[line %u] ", (unsigned int)regs->eax);
+    else
+        printf("[FMA line %u] ", (unsigned int)-regs->eax);
     return false;
 }
 
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Jan Beulich

When some FMA set of insns is included in the base instruction set (XOP, AVX512F, and AVX512-FP16 at present), simd_test() simply invokes fma_test(), negating its return value. In case of a failure this would yield a value close to 4G, which doesn't lend itself to easy identification of the failing test case. Recognize the case in simd_check_regs() and emit alternative output identifying FMA.