This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Supporting FP cmp lib routines
- From: Mohamed Shafi <shafitvm at gmail dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: GCC <gcc at gcc dot gnu dot org>
- Date: Fri, 23 Oct 2009 19:34:59 +0530
- Subject: Re: Supporting FP cmp lib routines
- References: <ba0bd44d0909140659u84447c2x32705cd72ce9d73a@mail.gmail.com> <4AAE580A.4080109@redhat.com> <4AAE695A.1030405@redhat.com>
2009/9/14 Richard Henderson <rth@redhat.com>:
> Another thing to look at, since you have hand-written routines and may be
> able to specify that e.g. only a subset of the normal call clobbered
> registers are actually modified, is to leave the call as a "compare" insn.
> ?Something like
>
> (define_insn "*cmpsf"
> ?[(set (reg:CC status-reg)
> ? ? ? ?(compare:CC
> ? ? ? ? ?(match_operand:SF 0 "register_operand" "R0")
> ? ? ? ? ?(match_operand:SF 1 "register_operand" "R1")))
> ? (clobber (reg:SI r2))
> ? (clobber (reg:SI r3))]
> ?""
> ?"call __compareSF"
> ?[(set_attr "type" "call")])
>
> Where the R0 and R1 constraints resolve to the input registers for the
> routine. ?Depending on your ISA and ABI, you may not even need to split this
> pattern post-reload.
>
I have implemented the above solution and it works. I have to support
the same for DF also. But with DF i have a problem with the
constraints. My target generates code for both big and little endian.
The ABI specifies that when a 64bit value is passed as an argument
they are passed in R6 and R7, R6 containing the most significant long
word and R7 containing the least significant long word, regardless of
the endianess mode. How can i do this in the DF compare pattern?
Regards,
Shafi