🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #46454

augmenting assembler code

#46454
From: Fabrizio Petrini
Date: Wed, 16 Nov 1994 11:13
28 lines
1803 bytes
Hi there!

I would like to use gcc/g++ to implement a simulator of parallel architectures.
In particular, I would like to insert "descheduling points" inside the user 
code. That is, I need to split the assembler code in "basic blocks"
and, at the end of each basic block, insert a call to a function 
(passing the size of the of the basic block). This function will deschedule
the process if necessary (e.g. when the the global instruction count 
exceeds a given timeslice). 

I would like to insert a new option in gcc (say -augment), resembling 
what is done during the profiling process. In fact (I suppose), when 
a program is profiled, the compiler inserts calls to the function _mcount
at the end of something similar to the basic blocks. 

Here is the problem.

What are the steps that I should follow?
What are the defines inside gcc that I have to modify?  
How can I define the grain size of the basic block?

Thanks a lot to all the gcc/g++ gurus for their invaluable help

Fabrizio Petrini
Dipartimento di Informatica
Corso Italia 40
56100 Pisa
e-mail: petrini@di.unipi.it
Technical Details
Message-ID: <3acpgv$q1o@serra.unipi.it>
Path: arc1-ca.pugleaf.net!nntp.gmd.de!newsserver.jvnc.net!netnews.upenn.edu!msuinfo!uwm.edu!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!serra.unipi.it!apollo.di.unipi.it!petrini

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,54f778bed682d2e1,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1994-11-16 03:13:35 PST
Path: arc1-ca.pugleaf.net!nntp.gmd.de!newsserver.jvnc.net!netnews.upenn.edu!msuinfo!uwm.edu!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!serra.unipi.it!apollo.di.unipi.it!petrini
From: petrini@di.unipi.it (Fabrizio Petrini)
Newsgroups: gnu.gcc.help
Subject: augmenting assembler code
Date: 16 Nov 1994 11:13:35 GMT
Organization: Dipartimento di Informatica, Universita' di Pisa
Lines: 29
Distribution: world
Message-ID: <3acpgv$q1o@serra.unipi.it>
NNTP-Posting-Host: apollo.di.unipi.it
X-Newsreader: TIN [version 1.2 PL2]