🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.lib.bug
Article #167

lack of inline functions in libg++

#167
From: Michael Tiemann
Date: Thu, 26 Oct 1989 16:17
53 lines
1483 bytes
    The code generated for inline fill() is  about the best you could get
    anywhere:

    _fill__FR10Vec1000000f:
	    !#PROLOGUE# 0
	    save %sp,-112,%sp
	    !#PROLOGUE# 1
	    mov %i1,%o2
	    sethi %hi(1000000),%o0
	    or %lo(1000000),%o0,%o0
	    mov %i0,%o1
	    sll %o0,2,%o0
	    b L672
	    add %o0,%i0,%o0
    L677:
	    st %o2,[%o1]
	    add %o1,4,%o1
    L672:
	    cmp %o1,%o0
	    bl L677
	    nop
	    ret
	    restore



    -Doug

No, that code is bad.  GCC with my scheduling extensions would make
code which looked like this (honest!):

    _fill__FR10Vec1000000f:
	    !#PROLOGUE# 0
	    !#PROLOGUE# 1
	    sethi %hi(1000000),%o2
	    or %lo(1000000),%o2,%o2
	    sll %o2,2,%o2
	    add %o2,%o0,%o2
	    st %o1,[%o0]
    L677:
	    add %o0,4,%o0
    L672:
	    cmp %o0,%o2
	    bl L678
	    st %o1,[%o0]
	    ret
	    nop

or something like it.  There's lots of fun you can have with an
optimizer.

Michael
Technical Details
Message-ID: <8910261617.AA05552@lurch.Stanford.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!LURCH.STANFORD.EDU!tiemann
References: <8910261030.AA01450@g.oswego.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!LURCH.STANFORD.EDU!tiemann
From: tiemann@LURCH.STANFORD.EDU (Michael Tiemann)
Newsgroups: gnu.g++.lib.bug
Subject: lack of inline functions in libg++
Message-ID: <8910261617.AA05552@lurch.Stanford.EDU>
Date: 26 Oct 89 16:17:02 GMT
References: <8910261030.AA01450@g.oswego.edu>
Sender: daemon@tut.cis.ohio-state.edu
Reply-To: tiemann@lurch.stanford.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 53