From: Gabe Black Date: Sat, 13 Feb 2021 01:25:24 +0000 (-0800) Subject: arch-x86: Use popCount from bitfields.hh. X-Git-Tag: develop-gem5-snapshot~73 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e16301f96b46799a5a9b1c43bf312aa19171f617;p=gem5.git 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 --- 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)) {