From e16301f96b46799a5a9b1c43bf312aa19171f617 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Fri, 12 Feb 2021 17:25:24 -0800 Subject: [PATCH] arch-x86: Use popCount from bitfields.hh. Use popCount from bitfields.hh rather than call __builtin_popcountl directly. That will ensure the instruction works whether or not that builtin is available. Change-Id: I947b35bb832b768936b489a58ee324adb8a90b5e Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/41354 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/arch/x86/isa/microops/regop.isa | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/arch/x86/isa/microops/regop.isa b/src/arch/x86/isa/microops/regop.isa index 570c0847f..63a16831c 100644 --- a/src/arch/x86/isa/microops/regop.isa +++ b/src/arch/x86/isa/microops/regop.isa @@ -1766,10 +1766,7 @@ let {{ ''' class Popcnt(RegOp): - code = ''' - DestReg = - merge(DestReg, __builtin_popcountl(psrc1), dataSize); - ''' + code = 'DestReg = merge(DestReg, popCount(psrc1), dataSize);' flag_code = ''' ccFlagBits = ccFlagBits & ~(SFBit | AFBit | ZFBit | PFBit); if (findZero(dataSize * 8, SrcReg1)) { -- 2.30.2