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 <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2021-02-12 17:25:24 -08:00
parent 13cda5a734
commit e16301f96b

View File

@@ -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)) {