From be078e2a82f8eba7f26291c297c256dc77edb04a Mon Sep 17 00:00:00 2001 From: liufang Date: Mon, 11 Sep 2023 16:53:28 +0000 Subject: [PATCH] [IGC vISA] Minor code change in getFPSPGRF(). Minor code change in getFPSPGRF(). --- visa/G4_Kernel.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/visa/G4_Kernel.cpp b/visa/G4_Kernel.cpp index ce0a5757b389..a785e960a447 100644 --- a/visa/G4_Kernel.cpp +++ b/visa/G4_Kernel.cpp @@ -861,12 +861,17 @@ uint32_t StackCallABI::numReservedABIGRF() const { } uint32_t StackCallABI::getFPSPGRF() const { - // For ABI V1 return r125. - // For ABI V2, V3 return r127. - if (version == StackCallABIVersion::VER_1) + // For ABI V1, return (numRegTotal - 3), i.e. 125. + // For ABI V2, return (numRegTotal - 1), i.e. 127, 255. + // For ABI V3, return (numRegTotal - 1), i.e. 127, 255. + + if (version == StackCallABIVersion::VER_1) { return getStackCallStartReg() + FPSPGRF; - else + } else if (version == StackCallABIVersion::VER_2) { return (kernel->getNumRegTotal() - 1) - FPSPGRF; + } else { + return (kernel->getNumRegTotal() - 1) - FPSPGRF; + } } uint32_t StackCallABI::getSpillHeaderGRF() const {