This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


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

Re: Control flow implementation in assembler


   Date: Wed, 15 Mar 2000 16:43:24 -0800 (PST)
   From: Chandra Chavva <cchavva@cygnus.com>

   I am working on SCEI project. As per the contract, i need to implement 
   warning message for some sequence of instructions taking account of 
   control flow.

Cygnus contracts are only of mild interest to the readers of
binutils@sourceware.cygnus.com, a list most of whose members do not
work at Cygnus.

   In this example, even when addq insn is 8 insns apart from div insn, 
   still assembler needs to give warning message because at run time the 
   branch insn will make addq 1 insn apart to div insn. 

If the processor has call instructions, I don't see how you can do
this correctly.  If a div is followed by a call, then you are in
trouble if any instruction at the start of the function being called
uses the Q register.  But the assembler can't know that.

To do this correctly within a single file, you need to build a control
flow graph.  Nothing in the assembler does that right now.  Still,
it's not that hard.  Just record labels, branches, instruction counts,
and uses of the Q register.

Ian

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