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:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user