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: RE: PPC compiler splits up ints & shorts?
From: "Lawrence T. Hoff" <[email protected]>
To: "'Laznovsky, Michael'" <[email protected]>, <[email protected]>
Date: Wed, 29 Sep 2004 05:45:47 -0400
	Interesting. "my" compiler does not do that, therefore I 
cannot know for sure how to help out. In general, however, compilers
are free to treat memory locations in any way they see fit, unless
you use the "volatile" qualifier, which tells the compiler that
an address does *not* behave like a typical memory cell, and that
no assumptions can be made for purposes of optimization. I.e.
Try this instead (or compile with -fvolatile):

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

	With my compiler it made no difference. All accesses were
32-bit.

HTH -- Larry

GNU C version gcc-2.96 (2.96+) 19990621 AltiVec (powerpc-wrs-vxworks)
compiled by GNU C version 2.96 20000731 (Red Hat Linux 7.3 2.96-113).

        .align 2
        .type    copy4,@function
copy4:
        mr 0,5
        cmpwi 0,0,0
        addi 5,5,-1
        bclr 4,1
.L5:
        mr 0,5
        lwz 9,0(3)
        cmpwi 0,0,0
        stw 9,0(4)
        addi 3,3,4
        addi 4,4,4
        addi 5,5,-1
        bc 12,1,.L5
        blr



References:
PPC compiler splits up ints & shorts? Laznovsky, Michael

Navigate by Date:
Prev: RE: PPC compiler splits up ints & shorts? Laznovsky, Michael
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 
Navigate by Thread:
Prev: PPC compiler splits up ints & shorts? Laznovsky, Michael
Next: Re: PPC compiler splits up ints & shorts? Dirk Zimoch
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 ·