Re: Automatic "code-pattern" recognition, in DSP codes

Oliver Bandel <oliver@first.in-berlin.de>
11 Jul 2005 07:02:24 -0400

          From comp.compilers

Related articles
Automatic "code-pattern" recognition, in DSP codes Miguel.CasasSanchez@ucd.ie (=?ISO-8859-15?Q?Miguel_Cas=E1s-S=E1nchez?=) (2005-07-05)
Re: Automatic "code-pattern" recognition, in DSP codes jle@ural.owlnet.rice.edu (2005-07-11)
Re: Automatic "code-pattern" recognition, in DSP codes bsheff2@yahoo.com (Bob Sheff) (2005-07-11)
Re: Automatic "code-pattern" recognition, in DSP codes codeworker@free.fr (=?iso-8859-1?q?C=E9dric_LEMAIRE?=) (2005-07-11)
Re: Automatic "code-pattern" recognition, in DSP codes darius@raincode.com (Darius Blasband) (2005-07-11)
Re: Automatic "code-pattern" recognition, in DSP codes drizzle76@gmail.com (drizzle) (2005-07-11)
Re: Automatic "code-pattern" recognition, in DSP codes oliver@first.in-berlin.de (Oliver Bandel) (2005-07-11)
Re: Automatic "code-pattern" recognition, in DSP codes pohjalai@cc.helsinki.fi (A Pietu Pohjalainen) (2005-07-11)
| List of all articles for this month |

From: Oliver Bandel <oliver@first.in-berlin.de>
Newsgroups: comp.compilers
Date: 11 Jul 2005 07:02:24 -0400
Organization: Individual Network Berlin e.V.
References: 05-07-024
Keywords: DSP, code
Posted-Date: 11 Jul 2005 07:02:24 EDT

Hi,


Miguel Casás-Sánchez wrote:


> Hi
>
> I am researching in compilers and source to source code transformations,
> for Digital Signal Processors, in particular with the Texas Instruments
> Code Composer Studio 2.2 for the 55x family.
>
> I was wondering if somebody has ever heard about something like
> "automatic typical DSP-like kernel recognition", for example, as the
> compiler reads the program and sets up the data and control graphs,
> recognise that
>
> for(i=0, acc = 0; i < N; i++) {
> acc = h[n] * X[N-n];
> }
>
> can be a FIR filter, that may be substituted as a whole by a fir()
> library function call, most optimised.


CAN BE a fir filter, but can be something else too...


Is it necessary for you to recode already existing code,
or do you want to change code that will be written in
the future?


If the latter, it maybe would make more sense to write your own
signal-processing high-level language (Domain Specific Language (DSL))
and then only change the output section of this DSL to either
library or self-written code.






>
> Can be also understood as pattern-search in the code control/data graphs?


You can rewrite the above code. Maybe another programmer would
write it in a way that you don't see at the first view that it does
the same, even with trained eyes.
There are nearly as much programming styles out there as there are
programmers...


So what you have to detect is the underlying mathematical operation.
So you must create an optimizing C-compiler which detects
high-level stuff like an underlying mathematical operation,
e.g. convolution, fft, end so on.


With functional languages this should be a much easier task,
but with C it's near to a horror. ;-(


Ciao,
        Oliver


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.