You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by jean-frederic clere <jf...@fujitsu-siemens.com> on 2002/02/20 17:00:00 UTC
Re: cvs commit: apr/test testatomic.c
It works only with the native "as" but not with "gas".
ianh@apache.org wrote:
>
> ianh 02/02/19 15:45:06
>
> Modified: . configure.in
> atomic/solaris_sparc apr_atomic_sparc.s
> include apr_atomic.h
> test testatomic.c
> Log:
> enable sun-sparc specific code
>
> Revision Changes Path
> 1.409 +12 -0 apr/configure.in
>
> Index: configure.in
> ===================================================================
> RCS file: /home/cvs/apr/configure.in,v
> retrieving revision 1.408
> retrieving revision 1.409
> diff -u -r1.408 -r1.409
> --- configure.in 15 Feb 2002 22:36:40 -0000 1.408
> +++ configure.in 19 Feb 2002 23:45:06 -0000 1.409
> @@ -322,6 +322,18 @@
> enable_threads="no"
> eolstr="\\n"
> ;;
> + *sun*)
> + case $host_cpu in
> + *sparc*)
> + OSDIR="solaris_sparc"
> + eolstr="\\n"
> + ;;
> + *)
> + OSDIR="unix"
> + eolstr="\\n"
> + ;;
> + esac
> + ;;
> *)
> OSDIR="unix"
> eolstr="\\n"
>
>
>
> 1.3 +30 -7 apr/atomic/solaris_sparc/apr_atomic_sparc.s
>
> Index: apr_atomic_sparc.s
> ===================================================================
> RCS file: /home/cvs/apr/atomic/solaris_sparc/apr_atomic_sparc.s,v
> retrieving revision 1.2
> retrieving revision 1.3
> diff -u -r1.2 -r1.3
> --- apr_atomic_sparc.s 17 Feb 2002 20:17:53 -0000 1.2
> +++ apr_atomic_sparc.s 19 Feb 2002 23:45:06 -0000 1.3
> @@ -71,19 +71,20 @@
> !
> ENTRY(apr_atomic_add_sparc)
>
> - ld [%o0], %o2
> + ld [%o0], %o2 ! set o2 to current value
> _apr_atomic_add_sparc_loop:
> - add %o2, %o1, %o3
> - cas [%o0], %o2, %o3
> - cmp %o2, %o3
> - bne,a _apr_atomic_add_sparc_loop
> - ld [%o0], %o2
> + add %o2, %o1, %o3 ! o3 = o2 + o1
> + cas [%o0], %o2, %o3 ! if cur-val==o2 then cur-val=03
> + cmp %o2, %o3 ! see if the CAS worked
> + bne,a _apr_atomic_add_sparc_loop ! if not try again
> + ld [%o0], %o2 ! return the previous value
> retl
> mov %o3, %o0
>
> SET_SIZE(apr_atomic_add_sparc)
> !
> !
> +!
> ENTRY(apr_atomic_sub_sparc)
>
> ld [%o0], %o2
> @@ -96,5 +97,27 @@
> retl
> mov %o3, %o0
>
> - SET_SIZE(apr_atomic_sub_sparc)
> + SET_SIZE(apr_atomic_sub_sparc)
> +!
> +!
> +!
> +! %o0 [input] - the address of the value to compare
> +! %o1 [input] - the new value
> +! %o2 [input] - value to compare against
> +! %o0 [output] - the return value
> +!
> + ENTRY(apr_atomic_cas_sparc)
> + ENTRY(apr_atomic_casptr_sparc)
> +
> + cas [%o0], %o2, %o1
> + cmp %o1, %o2 ! if o1 == o2 values weren't swapped
> + bne,a _apr_atomic_cas_ne
> + mov %o2, %o0
> + retl
> + mov %o2, %o0
> +_apr_atomic_cas_ne:
> + retl
> + mov %o1, %o0
> +
> + SET_SIZE(apr_atomic_cas_sparc)
>
>
>
>
> 1.8 +1 -1 apr/include/apr_atomic.h
>
> Index: apr_atomic.h
> ===================================================================
> RCS file: /home/cvs/apr/include/apr_atomic.h,v
> retrieving revision 1.7
> retrieving revision 1.8
> diff -u -r1.7 -r1.8
> --- apr_atomic.h 19 Feb 2002 23:15:40 -0000 1.7
> +++ apr_atomic.h 19 Feb 2002 23:45:06 -0000 1.8
> @@ -173,7 +173,7 @@
>
> #define APR_ATOMIC_NEED_CAS_DEFAULT 1
>
> -#elif defined(__sparc__not_yet)
> +#elif defined(__sparc__)
> #define apr_atomic_t apr_uint32_t
> #define apr_atomic_read(p) *p
>
>
>
>
> 1.5 +0 -1 apr/test/testatomic.c
>
> Index: testatomic.c
> ===================================================================
> RCS file: /home/cvs/apr/test/testatomic.c,v
> retrieving revision 1.4
> retrieving revision 1.5
> diff -u -r1.4 -r1.5
> --- testatomic.c 19 Feb 2002 23:15:39 -0000 1.4
> +++ testatomic.c 19 Feb 2002 23:45:06 -0000 1.5
> @@ -83,7 +83,6 @@
> return APR_EGENERAL;
> }
> printf("OK\n");
> - printf("debug\n y=%d\n",y);
> printf("%-60s", "testing CAS - match non-null");
> oldval = apr_atomic_cas(&y,23,12);
> if (oldval != 12) {
>
>
>
Re: cvs commit: apr/test testatomic.c
Posted by Ian Holsman <ia...@apache.org>.
jean-frederic clere wrote:
> Hi,
>
> I have committed some changes but I am not happy...
> Instead using cpp it would be better to use gcc directly:
>
> gcc -Wa,-xarch=v8plus -D_ASM -D__STDC__=0 -c apr_atomic_sparc.S -o
> apr_atomic_sparc.lo
what happens when people are using forte's compiler?
>
> I have just to change apr_atomic_sparc.s into apr_atomic_sparc.S. The native
> solaris as accepts the *.S files.
>
> Any comments?
>
> Cheers
>
> Jean-frederic
>
> "Clere, Jean-Frederic" wrote:
>
>>Dale Ghent wrote:
>>
>>>On Wed, 20 Feb 2002, Ian Holsman wrote:
>>>
>>>| jean-frederic clere wrote:
>>>| > It works only with the native "as" but not with "gas".
>>>|
>>>| is this a problem on solaris?
>>>| doesn't every box come with 'as' out of the box?
>>>
>>>It doesnt install with the basic installation scheme. The SUNWsprot and
>>>SUNWbtool/SUNWbtoox packages need to be installed.
>>>
>>>The other caveat is that /usr/ccs/bin isnt in alot of peoples' paths, so
>>>it is overlooked, and they then install the (inferior) GNU binutils.
>>>
>>>/dale
>>>
>>I think it is possible to get the file assembled by gnu as... It just need to be
>>preprocessed by gnu cpp before.
>>+++
>>cpp -D_ASM -D__STDC__=0 $*.s > $*.S
>>as -xarch=v8plus -K PIC -q -o $@ $*.S
>>+++
>>Any comments? -Now I will add the need things in configure and makefile -
>>
>>Cheers
>>
>>Jean-Frederic
>>
>
Re: cvs commit: apr/test testatomic.c
Posted by jean-frederic clere <jf...@fujitsu-siemens.com>.
Hi,
I have committed some changes but I am not happy...
Instead using cpp it would be better to use gcc directly:
gcc -Wa,-xarch=v8plus -D_ASM -D__STDC__=0 -c apr_atomic_sparc.S -o
apr_atomic_sparc.lo
I have just to change apr_atomic_sparc.s into apr_atomic_sparc.S. The native
solaris as accepts the *.S files.
Any comments?
Cheers
Jean-frederic
"Clere, Jean-Frederic" wrote:
>
> Dale Ghent wrote:
> >
> > On Wed, 20 Feb 2002, Ian Holsman wrote:
> >
> > | jean-frederic clere wrote:
> > | > It works only with the native "as" but not with "gas".
> > |
> > | is this a problem on solaris?
> > | doesn't every box come with 'as' out of the box?
> >
> > It doesnt install with the basic installation scheme. The SUNWsprot and
> > SUNWbtool/SUNWbtoox packages need to be installed.
> >
> > The other caveat is that /usr/ccs/bin isnt in alot of peoples' paths, so
> > it is overlooked, and they then install the (inferior) GNU binutils.
> >
> > /dale
>
> I think it is possible to get the file assembled by gnu as... It just need to be
> preprocessed by gnu cpp before.
> +++
> cpp -D_ASM -D__STDC__=0 $*.s > $*.S
> as -xarch=v8plus -K PIC -q -o $@ $*.S
> +++
> Any comments? -Now I will add the need things in configure and makefile -
>
> Cheers
>
> Jean-Frederic
Re: cvs commit: apr/test testatomic.c
Posted by jean-frederic clere <jf...@fujitsu-siemens.com>.
Dale Ghent wrote:
>
> On Wed, 20 Feb 2002, Ian Holsman wrote:
>
> | jean-frederic clere wrote:
> | > It works only with the native "as" but not with "gas".
> |
> | is this a problem on solaris?
> | doesn't every box come with 'as' out of the box?
>
> It doesnt install with the basic installation scheme. The SUNWsprot and
> SUNWbtool/SUNWbtoox packages need to be installed.
>
> The other caveat is that /usr/ccs/bin isnt in alot of peoples' paths, so
> it is overlooked, and they then install the (inferior) GNU binutils.
>
> /dale
I think it is possible to get the file assembled by gnu as... It just need to be
preprocessed by gnu cpp before.
+++
cpp -D_ASM -D__STDC__=0 $*.s > $*.S
as -xarch=v8plus -K PIC -q -o $@ $*.S
+++
Any comments? -Now I will add the need things in configure and makefile -
Cheers
Jean-Frederic
Re: cvs commit: apr/test testatomic.c
Posted by Dale Ghent <da...@elemental.org>.
On Wed, 20 Feb 2002, Ian Holsman wrote:
| jean-frederic clere wrote:
| > It works only with the native "as" but not with "gas".
|
| is this a problem on solaris?
| doesn't every box come with 'as' out of the box?
It doesnt install with the basic installation scheme. The SUNWsprot and
SUNWbtool/SUNWbtoox packages need to be installed.
The other caveat is that /usr/ccs/bin isnt in alot of peoples' paths, so
it is overlooked, and they then install the (inferior) GNU binutils.
/dale
Re: cvs commit: apr/test testatomic.c
Posted by Ian Holsman <ia...@apache.org>.
jean-frederic clere wrote:
> It works only with the native "as" but not with "gas".
is this a problem on solaris?
doesn't every box come with 'as' out of the box?
I don't have the gnu-assembler installed on my solaris machines
if you think it gas on solaris support is needed can you supply me a
patch or tell me what is going wrong with it?
TIA
Ian
>
> ianh@apache.org wrote:
>
>>ianh 02/02/19 15:45:06
>>
>> Modified: . configure.in
>> atomic/solaris_sparc apr_atomic_sparc.s
>> include apr_atomic.h
>> test testatomic.c
>> Log:
>> enable sun-sparc specific code
>>
>> Revision Changes Path
>> 1.409 +12 -0 apr/configure.in
>>
>> Index: configure.in
>> ===================================================================
>> RCS file: /home/cvs/apr/configure.in,v
>> retrieving revision 1.408
>> retrieving revision 1.409
>> diff -u -r1.408 -r1.409
>> --- configure.in 15 Feb 2002 22:36:40 -0000 1.408
>> +++ configure.in 19 Feb 2002 23:45:06 -0000 1.409
>> @@ -322,6 +322,18 @@
>> enable_threads="no"
>> eolstr="\\n"
>> ;;
>> + *sun*)
>> + case $host_cpu in
>> + *sparc*)
>> + OSDIR="solaris_sparc"
>> + eolstr="\\n"
>> + ;;
>> + *)
>> + OSDIR="unix"
>> + eolstr="\\n"
>> + ;;
>> + esac
>> + ;;
>> *)
>> OSDIR="unix"
>> eolstr="\\n"
>>
>>
>>
>> 1.3 +30 -7 apr/atomic/solaris_sparc/apr_atomic_sparc.s
>>
>> Index: apr_atomic_sparc.s
>> ===================================================================
>> RCS file: /home/cvs/apr/atomic/solaris_sparc/apr_atomic_sparc.s,v
>> retrieving revision 1.2
>> retrieving revision 1.3
>> diff -u -r1.2 -r1.3
>> --- apr_atomic_sparc.s 17 Feb 2002 20:17:53 -0000 1.2
>> +++ apr_atomic_sparc.s 19 Feb 2002 23:45:06 -0000 1.3
>> @@ -71,19 +71,20 @@
>> !
>> ENTRY(apr_atomic_add_sparc)
>>
>> - ld [%o0], %o2
>> + ld [%o0], %o2 ! set o2 to current value
>> _apr_atomic_add_sparc_loop:
>> - add %o2, %o1, %o3
>> - cas [%o0], %o2, %o3
>> - cmp %o2, %o3
>> - bne,a _apr_atomic_add_sparc_loop
>> - ld [%o0], %o2
>> + add %o2, %o1, %o3 ! o3 = o2 + o1
>> + cas [%o0], %o2, %o3 ! if cur-val==o2 then cur-val=03
>> + cmp %o2, %o3 ! see if the CAS worked
>> + bne,a _apr_atomic_add_sparc_loop ! if not try again
>> + ld [%o0], %o2 ! return the previous value
>> retl
>> mov %o3, %o0
>>
>> SET_SIZE(apr_atomic_add_sparc)
>> !
>> !
>> +!
>> ENTRY(apr_atomic_sub_sparc)
>>
>> ld [%o0], %o2
>> @@ -96,5 +97,27 @@
>> retl
>> mov %o3, %o0
>>
>> - SET_SIZE(apr_atomic_sub_sparc)
>> + SET_SIZE(apr_atomic_sub_sparc)
>> +!
>> +!
>> +!
>> +! %o0 [input] - the address of the value to compare
>> +! %o1 [input] - the new value
>> +! %o2 [input] - value to compare against
>> +! %o0 [output] - the return value
>> +!
>> + ENTRY(apr_atomic_cas_sparc)
>> + ENTRY(apr_atomic_casptr_sparc)
>> +
>> + cas [%o0], %o2, %o1
>> + cmp %o1, %o2 ! if o1 == o2 values weren't swapped
>> + bne,a _apr_atomic_cas_ne
>> + mov %o2, %o0
>> + retl
>> + mov %o2, %o0
>> +_apr_atomic_cas_ne:
>> + retl
>> + mov %o1, %o0
>> +
>> + SET_SIZE(apr_atomic_cas_sparc)
>>
>>
>>
>>
>> 1.8 +1 -1 apr/include/apr_atomic.h
>>
>> Index: apr_atomic.h
>> ===================================================================
>> RCS file: /home/cvs/apr/include/apr_atomic.h,v
>> retrieving revision 1.7
>> retrieving revision 1.8
>> diff -u -r1.7 -r1.8
>> --- apr_atomic.h 19 Feb 2002 23:15:40 -0000 1.7
>> +++ apr_atomic.h 19 Feb 2002 23:45:06 -0000 1.8
>> @@ -173,7 +173,7 @@
>>
>> #define APR_ATOMIC_NEED_CAS_DEFAULT 1
>>
>> -#elif defined(__sparc__not_yet)
>> +#elif defined(__sparc__)
>> #define apr_atomic_t apr_uint32_t
>> #define apr_atomic_read(p) *p
>>
>>
>>
>>
>> 1.5 +0 -1 apr/test/testatomic.c
>>
>> Index: testatomic.c
>> ===================================================================
>> RCS file: /home/cvs/apr/test/testatomic.c,v
>> retrieving revision 1.4
>> retrieving revision 1.5
>> diff -u -r1.4 -r1.5
>> --- testatomic.c 19 Feb 2002 23:15:39 -0000 1.4
>> +++ testatomic.c 19 Feb 2002 23:45:06 -0000 1.5
>> @@ -83,7 +83,6 @@
>> return APR_EGENERAL;
>> }
>> printf("OK\n");
>> - printf("debug\n y=%d\n",y);
>> printf("%-60s", "testing CAS - match non-null");
>> oldval = apr_atomic_cas(&y,23,12);
>> if (oldval != 12) {
>>
>>
>>
>>
>