Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/41354 )

Change subject: arch-x86: Use popCount from bitfields.hh.
......................................................................

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 <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/arch/x86/isa/microops/regop.isa
1 file changed, 1 insertion(+), 4 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/arch/x86/isa/microops/regop.isa b/src/arch/x86/isa/microops/regop.isa
index 570c084..63a1683 100644
--- a/src/arch/x86/isa/microops/regop.isa
+++ b/src/arch/x86/isa/microops/regop.isa
@@ -1766,10 +1766,7 @@
         '''

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

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/41354
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I947b35bb832b768936b489a58ee324adb8a90b5e
Gerrit-Change-Number: 41354
Gerrit-PatchSet: 2
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to