[FFmpeg-devel] [PATCH] add cflags filtering rules for suncc
Michael Kostylev
michael.kostylev
Mon Nov 2 21:52:03 CET 2009
On Mon Nov 2 18:16:21 2009
M?ns Rullg?rd wrote:
>>>> --- ./configure.orig
>>>> +++ ./configure
>>>> @@ -1619,6 +1619,37 @@
>>>> cc_version="AV_STRINGIFY(__SUNPRO_C)"
>>>> DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
>>>> DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1'
>>>> + filter_cflags=suncc_flags
>>>> + suncc_flags(){
>>>> + for flag; do
>>>> + case $flag in
>>>> + -march=*|-mcpu=*)
>>>> + case "${flag#*=}" in
>>>> + native) echo -xtarget=native ;;
>>>
>>> We don't pass "native" directly to the compiler so it doesn't need to
>>> be handled here. Including it for completeness doesn't hurt though.
>>
>>>> + v9) echo -xarch=sparc ;;
>>>
>>> Isn't it better to use -xtarget here? That option takes more detailed
>>> chip names and sets -xarch appropriately.
>>
>> It takes a system name, e.g.
>> ultra, ultra2, ultra2i, ultra1/140,
>> ultra1/170, ultra1/200, ultra2/1170,
>> ultra2/1200, ultra2/1300, ultra2/2170,
>> ultra2/2200, ultra2/2300, ultra2e, ultra2i
>> and sets -xchip (-mtune for gcc), -xcache and -xarch.
>> How can we guess which system is implied?
>
> The x86 ones certainly map better to the names we use, being specific
> implementations, not general ISA levels. Use whatever gives the most
> accurate match for each name that might be passed to configure --cpu.
-xdryrun shows the following:
target expansion
pentium_pro -xarch=pentium_pro -xchip=pentium_pro -xcache=generic
pentium3 -xarch=sse -xchip=pentium3 -xcache=16/32/4:256/32/4
pentium4 -xarch=sse2 -xchip=pentium4 -xcache=8/64/4:256/128/8
opteron -xarch=sse2a -xchip=opteron -xcache=64/64/2:1024/64/16
core2 -xarch=ssse3 -xchip=core2 -xcache=32/64/8:4096/64/16
penryn -xarch=sse4_1 -xchip=penryn -xcache=32/64/8:6144/64/24
nehalem -xarch=sse4_2 -xchip=nehalem -xcache=32/64/8:256/64/8:8192/64/16
Starting from opteron the L2 cache parameters don't look accurate enough.
Of course, -xcache can be tuned but the table will grow and grow.
Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cflags_filtering_rules_for_suncc.diff
Type: text/x-diff
Size: 3084 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091102/debfde12/attachment.diff>
More information about the ffmpeg-devel
mailing list