EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: PPC compiler splits up ints & shorts?
From: "Laznovsky, Michael" <[email protected]>
To: <[email protected]>
Cc: "Laznovsky, Michael" <[email protected]>
Date: Tue, 28 Sep 2004 23:58:22 -0700
Hi- does anyone know why our power-pc compiler likes to turn short & int pointer
dereferences into byte moves, and how to get it to not to?  Some hardware may not
like this, as suggested by bus analyzer.

For instance, this code:

	static void copy4 (int *p, int *q, int n) {
	  while (n-- > 0) *q++ = *p++;
	}

generates this:

        .align 2
        .type    copy4,@function
copy4:
        mr 0,5
        cmpwi 1,0,0
        mr 7,3
        mr 6,4
        addi 5,5,-1
        bclr 4,5
        addi 4,4,3
        addi 3,3,3
.L16:
        lbz 9,-2(3)	<---
        lbz 11,-1(3)	<---
        lbz 10,0(3)	<---
        lbz 0,0(7)	<---
        addi 3,3,4
        addi 7,7,4
        mr 8,5
        addi 5,5,-1
        cmpwi 1,8,0
        slwi 0,0,24
        slwi 9,9,16
        or 9,9,0
        slwi 11,11,8
        or 11,11,9
        or 10,10,11
        srwi 0,10,24
        stb 0,0(6)	<---
        srwi 0,10,16
        stb 0,-2(4)	<---
        srwi 0,10,8
        stb 0,-1(4)	<---
        stb 10,0(4)	<---
        addi 4,4,4
        addi 6,6,4
        bc 12,5,.L16
        blr
.Lfe4:
        .size    copy4,.Lfe4-copy4

Switches which may be relevant:
    .../vxworks/devel/tor-2.0.2/cd/host/sun4-solaris2/bin/ccppc
        -B.../vxworks/devel/tor-2.0.2/cd/host/sun4-solaris2/lib/gcc-lib/
        -nostdinc
        -ansi
        -pedantic
        -DCPU=PPC604
        -D_GNU_TOOL
        -DTRUE=1
        -DNIVXI
        -O2
        -fstrength
        -reduce
        -Wall
        -DVXI
        -mcpu=604
        --no-builtin
        -mstrict-align
        -mlongcall
        -D_REENTRANT
        -DvxWorks
        -DV5_vxWorks
        -fno-builtin

"ccppc --version" yields:
	cygnus-2.7.2-960126 egcs-971225 tornado 2.0

I thought maybe #pragma pack() in the source had something to do with it, but that
made no difference.

I took a look in the tech-talk archives, but couldn't find anything related.  Could
be just poor search skills....

Thanks for any help!

Mike


Replies:
RE: PPC compiler splits up ints & shorts? Lawrence T. Hoff
Re: PPC compiler splits up ints & shorts? Dirk Zimoch

Navigate by Date:
Prev: Re: How to add gpib device support Eric Norum
Next: RE: PPC compiler splits up ints & shorts? Laznovsky, Michael
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Forcing a record to be processed Ralph Lange
Next: RE: PPC compiler splits up ints & shorts? Lawrence T. Hoff
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·