avr-gcc-list
[Top][All Lists]
Advanced

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

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


From: Ruud Vlaming
Subject: Re: [avr-gcc-list] Transfer bit conserved by gcc?
Date: Fri, 19 Sep 2008 23:38:20 +0200
User-agent: KMail/1.9.1

On Friday 19 September 2008 16:25, you wrote:
> 
> > Is it true that avr-gcc never produces code that makes 
> > explicit use of the T-bit? 
> 
> No.
> In GCC 4.3.2, in the machine description for the avr 
> (gcc/config/avr/avr.md), there is define_insn "abssf2" 
> that will use the T bit. It generates a CLT and BLD 
> instructions. 
Thanks for this information Eric.

> However, I have no idea how often the  define_insn 
> "abssf2" will trigger. But yes, there is a  possibility.     
The md file states:

(define_insn "abssf2"
  [(set (match_operand:SF 0 "register_operand" "=d,r")
        (abs:SF (match_operand:SF 1 "register_operand" "0,0")))]
  ""
  "@
        andi %D0,0x7f
        clt\;bld %D0,7"
  [(set_attr "length" "1,2")
   (set_attr "cc" "set_n,clobber")])

I don't know how to read it, but loosely interpreted i 
understand the following:
abssf2 seems to be involved in the calculation of the
absolute value of a single precesion float. There are 
two ways to clean the msb of register %DO:
- one is and immideate with 0x7f and the 
- second is clear the T bit and load that zero on msb
Now since the first only works on registers r16 to r31 
sometimes the compiler chooses the second option?

Ruud







reply via email to

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