Results 1 to 3 of 3

Thread: Interactive Compiler explorer

  1. #1
    Member
    Join Date
    Nov 2014
    Location
    California
    Posts
    158
    Thanks
    51
    Thanked 44 Times in 33 Posts

    Interactive Compiler explorer

    Not perfect but can be pretty useful (especially to compare compiler output):

    http://gcc.godbolt.org/

    Example:

    int square(int num) {
    return num * num;
    }

    square(int):
    pushq %rbp
    movq %rsp, %rbp
    movl %edi, -4(%rbp)
    movl -4(%rbp), %eax
    imull -4(%rbp), %eax
    popq %rbp
    ret

  2. Thanks:

    nikkho (21st June 2016)

  3. #2
    Member nikkho's Avatar
    Join Date
    Jul 2011
    Location
    Spain
    Posts
    554
    Thanks
    223
    Thanked 166 Times in 107 Posts
    Very nice, allowing to use different compilers, and compilation flags.

  4. #3
    Member nikkho's Avatar
    Join Date
    Jul 2011
    Location
    Spain
    Posts
    554
    Thanks
    223
    Thanked 166 Times in 107 Posts
    Here is same example code with ICC 13, and -O3:
    Code:
    L__routine_start__Z6squarei_0:
    square(int):
            imull     %edi, %edi                                    #2.15
            movl      %edi, %eax                                    #2.15
            ret                                                     #2.15

Similar Threads

  1. Zpaq Explorer 0.1
    By surfersat in forum Data Compression
    Replies: 47
    Last Post: 8th November 2017, 19:39
  2. Intel C compiler find cpuid check
    By VoLT in forum The Off-Topic Lounge
    Replies: 2
    Last Post: 6th September 2012, 11:24
  3. Compiler / OS / Architecture / ... detection macros
    By m^2 in forum The Off-Topic Lounge
    Replies: 1
    Last Post: 12th October 2011, 00:30
  4. Cool compiler benchmark
    By m^2 in forum The Off-Topic Lounge
    Replies: 0
    Last Post: 31st January 2011, 21:14
  5. Cygwin-hosted Linux cross compiler (G++ 3.3.6)
    By Rugxulo in forum Data Compression
    Replies: 1
    Last Post: 5th June 2009, 04:02

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •