This is the mail archive of the gcc@gcc.gnu.org mailing 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]

Re: Require help with the backend in gcc


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thank you for a quick reply! :)

I was to do dynamic cpu dispatching code (which could also benefit
autovectorization). I'm checking out the trunk now.

I've already implemented an userland library to do cpu detection, and
the initialization hook goes into expand_main; I'm looking forward to
using this framework.

Thank you once again!

Karthik

"V. Karthik Kumar" <karthikkumar@gmail.com> writes:

> I require help with some work i've been doing lately on gcc (4.2.1
> tree). I have managed to put some code in.
>
> Now, for function compilation, i require to invoke the i386 (as of
> now) backend multiple times and with different switches; one time with
> 3dnow!, another with mmx, another with sse2. And floating point code
> will require usage of both 387 and sse.
>
> It is intended that multiple archs are passed as part of the -march
> option. (-m3dnow,sse2,sse3  or -march=k6,nocona or maybe
> -march=sse2,sse3)
>
> Eventually, some of this code may also get used in the PowerPC backend
> (one time with AltiVec and one time without)..
>
> it is intended that multiple versions of functions would go into the
> assembly file; The global data segment would be created only once,
> aligned to targeted instruction sets' requirement for efficient
> accesses (if mmx and sse, alignment might be 8 bytes than 4).
>
> I have started working, but not sure which parts I should be touching
> by now.
>
> Please give me your suggestions. Any help in this regard would be
> greatly appreciated.

The first thing you need to do is move to mainline, and take advantage
of the patch by Sandra Loosemore, David Ung, and Nigel Stephens to add
TARGET_SET_CURRENT_FUNCTION.  That is the framework you'll need to
change the architecture on a per-function basis.

Then you'll need to figure out how to clone the function the way the
inliner does, and presumably give each copy different names or
something--you didn't mention how you plan to handle that issue.

Then you can wind up compiling each function with different
parameters.

This is a nontrivial exercise, but an interesting one.  Good luck.

Ian

- --
- -----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.7 (GNU/Linux)

mQGiBEa0y88RBACpSIuwbUvraagYtkWKMlwe+KI6Sh2UU2vipE8Fotkrq/iTnRiK
pu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ka0y88CGwwFCQHhM4AACgkQRzTnZfDdIE91ngCgpgLiwwXQ
MbyOCWjuWGY+phmYeagAnj7nMffLNWLpfVmKtA4yrtOHkSAM
=RuU8
- -----END PGP PUBLIC KEY BLOCK-----
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG+qbnRzTnZfDdIE8RAttoAJ43zPb6TvQ32exV0O2oIER1E7jLegCfWcIW
1WHocs+ml0VSyx/q2g8PmMU=
=wBtI
-----END PGP SIGNATURE-----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]