double inv(double x) { return 1/x; }

$ gcc -Wall soft.c -O2 -S -msoft-float
$ cat soft.s
(...)
.LC0:   .long   0
        .long   1072693248
(...)
inv:    movlpd  .LC0(%rip), %xmm1
        divsd   %xmm0, %xmm1
        movsd   %xmm1, %xmm0
        ret

`-msoft-float -mno-sse2` is workaround to get library calls.

inv:    subq    $8, %rsp
        movaps  %xmm0, %xmm1
        movlps  .LC0(%rip), %xmm0
        call    __divdf3
        addq    $8, %rsp
        ret


-- 
           Summary: -msoft-float doesn't generate library calls.
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pluto at agmk dot net
 GCC build triplet: x86-64
  GCC host triplet: x86-64
GCC target triplet: x86-64


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25749


Reply via email to