RFC/PATCH: via c3 support

Jeff Garzik jgarzik@mandrakesoft.com
Wed Sep 11 20:43:00 GMT 2002


Adds processor_alias support for x86 clones winchip{2,c6}, and their
derivative, Via C3.

There exists public info for all these chips, but the datasheets don't
seem to have [to my amateur eyes] the level of detail necessary to fully
fill out the processor_costs table and all those const int x86_* flags
in i386.c.  Feel free to correct me on this :)

Winchip datasheets: http://www.centtech.com/designs.html
Via C3 datasheets:
http://www.viatech.com/jsp/en/products/viac3/c3.jsp#datasheets
[amusing stamped 'Via Confidential' even though it is posted publicly
under their 'Datasheets' link]

As an initial suggestion, I was thinking of a phased integration of
winchip/c3 support:

stage 1: processor alias, as attached
stage 2: remove aliases.  create separate PROCESSOR_WINCHIP type.  copy 
the i486 processor costs info, but leave unmodified [unless there are 
obviously better replacement values available].  figure out the x86_* 
flags through educated
guesses or by profiling generated code.
stage 3: automata specifically for winchip/c3
stage 4: peepholes, etc.

I only have the information to get to stage 2, for now.

I think it would be nice to have gcc support the C3 especially, since
they are still being manufactured and sold, but other x86 clones too if
people have the knowledge and time.  I believe pgcc already has the
beginnings of a processor costs table for the old 6x86, for example.

This patch has been bootstrapped and tested on i586-mandrake-linux. 
There was only one difference [or three, depending on your view:)] in 
the testing, and I was slack and chalked it up to an unrelated bug, 
since baseline and my hacked gcc failed in the same way on the same test:
> @@ -12,6 +12,12 @@
>  Using /home/jgarzik/repo/gcc-cyrix3/gcc/testsuite/config/default.exp as tool-and-target-specific interface file.
>  Running /home/jgarzik/repo/gcc-cyrix3/gcc/testsuite/gcc.c-torture/compile/compile.exp ...
>  WARNING: program timed out.
> +FAIL: gcc.c-torture/compile/20001226-1.c,  -O1  
> +WARNING: program timed out.
> +FAIL: gcc.c-torture/compile/20001226-1.c,  -O2  
> +WARNING: program timed out.
> +FAIL: gcc.c-torture/compile/20001226-1.c,  -O3 -fomit-frame-pointer  
> +WARNING: program timed out.
>  FAIL: gcc.c-torture/compile/20001226-1.c,  -O3 -g  
>  Running /home/jgarzik/repo/gcc-cyrix3/gcc/testsuite/gcc.c-torture/execute/execute.exp ...
>  Running /home/jgarzik/repo/gcc-cyrix3/gcc/testsuite/gcc.c-torture/execute/ieee/ieee.exp ...
[output of 'diff -u' of before-and-after make check output]

The patch is against cvs HEAD.

Comments?  On the patch's implementation, or what's above?

BTW this patch is dedicated to the public domain, as I don't have a
copyright assignment on file, and doing so would be a particular PITA at
the moment...

Regards,

	Jeff



2002-09-11  Jeff Garzik  <jgarzik@mandrakesoft.com>

	config.gcc: treat winchip_c6-*|winchip2-*|c3-* as pentium-mmx
	config/i386/i386.c (processor_alias_table):
	Add winchip-c6, winchip2 and c3.
	doc/invoke.texi: mention new aliases.




-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch-c3-stage1.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20020911/0608520e/attachment.txt>


More information about the Gcc-patches mailing list