This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix for GCC Bugzilla Bug 36133


Hi Andreas,

What is your opinion to this topic now?


Maybe I can summarize the question again.
When I understood your question correctly then it was:
"Does it make sense to mark the CC as invalid after a shift instruction."
Your point was that a shift will "trash" the carry flag.
If the CC is marked as valid GCC will but BCC instructions after the shift.
If the CC is marked as invalid then GCC will put a TST before the BCC
instruction to regenerate the conditions codes.

As a matter of fact TST will always clear the carry flag.
This means, that there can never be an BCC that depends on the carry
flag after the TST instruction.
There can of course only be BCC instructions after the TST that use
condition flags that are actually set by TST (these are N and Z)
The flags (N and Z ) are both correctly set ba the shift instruction as well.
Ergo: The TST instruction is redundant and should not by generated by GCC.
Ergo: The CC should be marked as valid after a shift or rotate instruction.

Do you agree with me here?

It would be good if we finally can fix this again.
AFAIK GCC 2.9  did behave correctly in this matter.

Cheers
Gunnar

The question basicly is does it make sense to makr the CC as invaklid
  "CC_STATUS_INIT"

On Thu, Jun 19, 2008 at 2:43 PM, Gunnar Von Boehn <gunnar@genesi-usa.com> wrote:
> Hallo Andreas,
>
>> The carry flag is used by bhi/bls, which are generated by the gtu/ltu
>> patterns.
>
> Can GCC create a BHI instructions that follows a LSR ?
> Honestly, I fail to see the possibility for this in GCC.
>
> Doesn't the BCC created by GCC behave like a BCC after a TST against ZERO?
> Isn't it true that such a BCC would never be a BHI but always a BNE or BEQ ?
>
> If you think its somehow possible to get GCC to create a BHI then
> please be so kind
> and help me to understand this and please give a C-example.
>
> Kind regards
> Gunnar
>


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