[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Transfer bit conserved by gcc?

From: Andy H
Subject: Re: [avr-gcc-list] Transfer bit conserved by gcc?
Date: Sun, 21 Sep 2008 20:34:01 -0400
User-agent: Thunderbird (Windows/20080708)

Gcc only tests certain conditions and requires zero, carry and overflow sign flags to be set usefully (ie indicating result). The real AVR flag status is translated to a similar internal flag set within gcc.

It does not use H flag or T flag. But certain sequences emitted by backend to synthesize gcc instruction might use any flag internally.

Each instruction template written defines what happens to CC_status - for example, "clobber" means instruction sequence leaves no useful information and "none" means sequence has no effect on flags. Gcc tracks this to see if explicit tests on results can be omitted.

You may note that gcc cant deal with sign flag only. So many instruction sequence results cant be tested for plus/minus - which causes otherwise redundant tests to be left in.


Ruud Vlaming wrote:
On Sunday 21 September 2008 22:22, you wrote:

T-bit is used by avr-gcc for internal purpose, the same way as temp reg (r0)
and cannot be used for storing value.
I see. I looked at it and i cannot get clear in which circumstances,
this is, but it does not really matter i suppose. Point is, you cannot destroy
the value of the Tbit at your liking, although i never saw the Tbit being used in my code by gcc.

And how about the H flag? The Half carry is produced by a lot of instructions,
but i never saw the compiler test for it,or make use of it. I looked the avr directory over for H flag tests or direct H flag manipulating functions (seh, clh, brhc, brhs) and found none.

You would really help me if you know more on this.


AVR-GCC-list mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]