Jagasia, Harsha - RE: [patch] tuning gcc for AMDFAM10 processor (patch 1) (original) (raw)
This is the mail archive of the gcc-patches@gcc.gnu.orgmailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
- From: "Jagasia, Harsha"
- To: "Andrew Pinski" , ak at suse dot de
- Cc: gcc-patches at gcc dot gnu dot org, "Meissner, Michael" , "rajagopal, dwarak"
- Date: Thu, 1 Feb 2007 11:47:36 -0600
- Subject: RE: [patch] tuning gcc for AMDFAM10 processor (patch 1)
Hi Andrew, Andi,
On Wednesday 31 January 2007 23:06, Jagasia, Harsha wrote:
Also I was wondering how hard it would be to make gcc detect code patterns automatically for the new bitfield instructions?
We are looking to submit a patch before stage 2 closes that can use the new extractq/insertq instructions for zero_extract, but we are not sure how viable it will be because these are SSEx instructions. But, I am not sure if you were referring to that or to auto generating popcnt/lzcnt instructions, which happen to be integer instructions.
I guess they can be generated for __builtin_popcount/__builtin_ffs[1] Detecting straight C patterns for these would be likely fruitless because there is no standard idiom to write them.
[1] That doesn't seem to exist right now, but perhaps it should be added.
__builtin_ffs is there: DEF_EXT_LIB_BUILTIN (BUILT_IN_FFS, "ffs", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST) DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSIMAX, "ffsimax", BT_FN_INT_INTMAX, ATTR_CONST_NOTHROW_LIST) DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSL, "ffsl", BT_FN_INT_LONG, ATTR_CONST_NOTHROW_LIST) DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSLL, "ffsll", BT_FN_INT_LONGLONG, ATTR_CONST_NOTHROW_LIST)
I think what Andi meant is we do not generate the new lzcnt/popcnt instructions for ffs* built-ins. We only generate them for the existing clz* and popcount* built-ins with -march=amdfam10. We do have plans to evaluate and submit another patch that generates popcnt/lzcnt instructions for ffs*, ctz* and possibly pairity* built-ins before stage 2 closes. We just wanted to get the basic functionality out sooner.
at least for integal types. Likewise for __builtin_popcount: DEF_GCC_BUILTIN (BUILT_IN_POPCOUNT, "popcount", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_POPCOUNTIMAX, "popcountimax", BT_FN_INT_UINTMAX, ATTR_CONST_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_POPCOUNTL, "popcountl", BT_FN_INT_ULONG, ATTR_CONST_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_POPCOUNTLL, "popcountll", BT_FN_INT_ULONGLONG, ATTR_CONST_NOTHROW_LIST)
They are not defined on vector types but that is a different story I think.
-- Pinski
Thanks, Harsha
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |