public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "nadavhalahmi560 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/100855] pow run time gfortran vs ifort
Date: Wed, 02 Jun 2021 09:37:36 +0000	[thread overview]
Message-ID: <bug-100855-4-5kTpgX9Myr@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100855-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100855

--- Comment #4 from Nadav Halahmi <nadavhalahmi560 at gmail dot com> ---
(In reply to Richard Biener from comment #3)
> Might be interesting to see whether ifort does any expression simplification
> here.  Can you share the produced assembly?

gfortran pow.f90 -O3 -fno-tree-vectorize -S -o gnu.s:

        .file   "pow.f90"
        .text
        .section        .rodata.str1.1,"aMS",@progbits,1
.LC5:
        .string "pow.f90"
.LC6:
        .string "(\"Time = \",f6.3,\" seconds.\")"
        .text
        .p2align 4
        .type   MAIN__, @function
MAIN__:
.LFB0:
        .cfi_startproc
        pushq   %rbp
        .cfi_def_cfa_offset 16
        .cfi_offset 6, -16
        xorl    %eax, %eax
        movl    $10000, %ebp
        pushq   %rbx
        .cfi_def_cfa_offset 24
        .cfi_offset 3, -24
        subq    $568, %rsp
        .cfi_def_cfa_offset 592
        leaq    20(%rsp), %rdi
        call    _gfortran_cpu_time_4
        pxor    %xmm4, %xmm4
        movss   .LC1(%rip), %xmm2
        movss   %xmm4, 8(%rsp)
.L4:
        movss   .LC2(%rip), %xmm0
        movl    $1, %ebx
        jmp     .L3
        .p2align 4,,10
        .p2align 3
.L8:
        movss   .LC3(%rip), %xmm1
        pxor    %xmm0, %xmm0
        movss   %xmm2, 12(%rsp)
        cvtsi2ssl       %ebx, %xmm0
        mulss   %xmm2, %xmm1
        addss   .LC4(%rip), %xmm1
        call    powf
        movss   12(%rsp), %xmm2
.L3:
        addss   8(%rsp), %xmm0
        addl    $1, %ebx
        mulss   .LC3(%rip), %xmm2
        movss   %xmm0, 8(%rsp)
        cmpl    $10001, %ebx
        jne     .L8
        subl    $1, %ebp
        jne     .L4
        leaq    16(%rsp), %rdi
        xorl    %eax, %eax
        movss   %xmm0, 24(%rsp)
        call    _gfortran_cpu_time_4
        leaq    32(%rsp), %rdi
        movabsq $25769803904, %rax
        movq    $.LC5, 40(%rsp)
        movq    %rax, 32(%rsp)
        movl    $21, 48(%rsp)
        call    _gfortran_st_write
        leaq    24(%rsp), %rsi
        movl    $4, %edx
        leaq    32(%rsp), %rdi
        call    _gfortran_transfer_real_write
        leaq    32(%rsp), %rdi
        call    _gfortran_st_write_done
        leaq    32(%rsp), %rdi
        movabsq $25769807872, %rax
        movq    $.LC5, 40(%rsp)
        movq    %rax, 32(%rsp)
        movl    $22, 48(%rsp)
        movq    $.LC6, 112(%rsp)
        movq    $28, 120(%rsp)
        call    _gfortran_st_write
        movss   16(%rsp), %xmm0
        subss   20(%rsp), %xmm0
        leaq    28(%rsp), %rsi
        leaq    32(%rsp), %rdi
        movl    $4, %edx
        movss   %xmm0, 28(%rsp)
        call    _gfortran_transfer_real_write
        leaq    32(%rsp), %rdi
        call    _gfortran_st_write_done
        addq    $568, %rsp
        .cfi_def_cfa_offset 24
        popq    %rbx
        .cfi_def_cfa_offset 16
        popq    %rbp
        .cfi_def_cfa_offset 8
        ret
        .cfi_endproc
.LFE0:
        .size   MAIN__, .-MAIN__
        .section        .text.startup,"ax",@progbits
        .p2align 4
        .globl  main
        .type   main, @function
main:
.LFB1:
        .cfi_startproc
        subq    $8, %rsp
        .cfi_def_cfa_offset 16
        call    _gfortran_set_args
        movl    $options.2.0, %esi
        movl    $7, %edi
        call    _gfortran_set_options
        call    MAIN__
        xorl    %eax, %eax
        addq    $8, %rsp
        .cfi_def_cfa_offset 8
        ret
        .cfi_endproc
.LFE1:
        .size   main, .-main
        .section        .rodata
        .align 16
        .type   options.2.0, @object
        .size   options.2.0, 28
options.2.0:
        .long   2116
        .long   4095
        .long   0
        .long   1
        .long   1
        .long   0
        .long   31
        .section        .rodata.cst4,"aM",@progbits,4
        .align 4
.LC1:
        .long   1073741824
        .align 4
.LC2:
        .long   1065353216
        .align 4
.LC3:
        .long   1056964608
        .align 4
.LC4:
        .long   1028443341
        .ident  "GCC: (GNU) 11.1.0"
        .section        .note.GNU-stack,"",@progbits

  parent reply	other threads:[~2021-06-02  9:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-01 13:01 [Bug fortran/100855] New: " nadavhalahmi560 at gmail dot com
2021-06-01 16:19 ` [Bug fortran/100855] " kargl at gcc dot gnu.org
2021-06-01 17:20 ` anlauf at gcc dot gnu.org
2021-06-02  7:52 ` rguenth at gcc dot gnu.org
2021-06-02  9:37 ` nadavhalahmi560 at gmail dot com [this message]
2021-06-02  9:38 ` nadavhalahmi560 at gmail dot com
2021-06-02 16:34 ` dominiq at lps dot ens.fr
2021-06-03  8:21 ` nadavhalahmi560 at gmail dot com
2021-06-03 14:24 ` dominiq at lps dot ens.fr
2021-06-05 11:59 ` dominiq at lps dot ens.fr
2021-06-06  8:52 ` nadavhalahmi560 at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-100855-4-5kTpgX9Myr@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).