Gabe Black has uploaded this change for review. ( 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
---
M src/arch/x86/isa/microops/regop.isa
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 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: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
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