From c262e3747b2b04f2db777315b5f8bd4d2a950e4c Mon Sep 17 00:00:00 2001 From: Rahil Shah Date: Tue, 12 Jul 2022 11:13:06 -0400 Subject: [PATCH] Set Vector Support in OMR While constructing a code generator object, check for vector facility and set appropriate options. This check was done previously in S390PrivateLinkage in OpenJ9, which would be incorrect place to do so. Fixes: #6572 Signed-off-by: Rahil Shah --- compiler/z/codegen/OMRCodeGenerator.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/compiler/z/codegen/OMRCodeGenerator.cpp b/compiler/z/codegen/OMRCodeGenerator.cpp index e85abdbc60..3a24a609b7 100644 --- a/compiler/z/codegen/OMRCodeGenerator.cpp +++ b/compiler/z/codegen/OMRCodeGenerator.cpp @@ -426,6 +426,18 @@ OMR::Z::CodeGenerator::initialize() _cgFlags = 0; + bool supportsAutoSIMD = !comp->getOption(TR_DisableSIMD) && comp->target().cpu.supportsFeature(OMR_FEATURE_S390_VECTOR_FACILITY); + + if(supportsAutoSIMD) + { + cg->setSupportsVectorRegisters(); + cg->setSupportsAutoSIMD(); + } + else + { + comp->setOption(TR_DisableSIMD); + } + // Initialize Linkage for Code Generator cg->initializeLinkage();