From 70376d43a3dfbbe2bd5f1e8d3735694a693d4341 Mon Sep 17 00:00:00 2001 From: Matthew Poremba Date: Tue, 16 Jan 2024 09:41:23 -0800 Subject: [PATCH] arch-vega: Fix upsize cast error in newer compilers (#774) Newer compilers error on -Warray-length in the recent MI200 patches due to casting from a 32-bit data type to a 64-bit type. Change it to cast the 32-bit integer first then 64-bit integer latter to remove the warning. Rerun of validation tests on the three instructions passed. Change-Id: I0309e5f7b5b8cc8ce1651660ddddb120fa6e7666 --- src/arch/amdgpu/vega/insts/instructions.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/arch/amdgpu/vega/insts/instructions.cc b/src/arch/amdgpu/vega/insts/instructions.cc index 5f951f860e..651b6dc9f9 100644 --- a/src/arch/amdgpu/vega/insts/instructions.cc +++ b/src/arch/amdgpu/vega/insts/instructions.cc @@ -46147,10 +46147,10 @@ namespace VegaISA *reinterpret_cast(&s1h), *reinterpret_cast(&s2h)); - uint64_t result1 = *reinterpret_cast(&dword1); - uint64_t result2 = *reinterpret_cast(&dword2); + uint32_t result1 = *reinterpret_cast(&dword1); + uint32_t result2 = *reinterpret_cast(&dword2); - vdst[lane] = (result2 << 32) | result1; + vdst[lane] = (static_cast(result2) << 32) | result1; } } @@ -46206,10 +46206,10 @@ namespace VegaISA float dword2 = *reinterpret_cast(&lower_dword) * *reinterpret_cast(&upper_dword); - uint64_t result1 = *reinterpret_cast(&dword1); - uint64_t result2 = *reinterpret_cast(&dword2); + uint32_t result1 = *reinterpret_cast(&dword1); + uint32_t result2 = *reinterpret_cast(&dword2); - vdst[lane] = (result2 << 32) | result1; + vdst[lane] = (static_cast(result2) << 32) | result1; } } @@ -46265,10 +46265,10 @@ namespace VegaISA float dword2 = *reinterpret_cast(&lower_dword) + *reinterpret_cast(&upper_dword); - uint64_t result1 = *reinterpret_cast(&dword1); - uint64_t result2 = *reinterpret_cast(&dword2); + uint32_t result1 = *reinterpret_cast(&dword1); + uint32_t result2 = *reinterpret_cast(&dword2); - vdst[lane] = (result2 << 32) | result1; + vdst[lane] = (static_cast(result2) << 32) | result1; } }