delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2013/12/11/14:20:31

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp AT delorie DOT com
Message-ID: <52A8BAEE.6000109@iki.fi>
Date: Wed, 11 Dec 2013 21:20:14 +0200
From: Andris Pavenis <andris DOT pavenis AT iki DOT fi>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: Using DJGPP for C++ DOS development today?
References: <0404a92b-e194-4e75-97b5-58c8e5b3c076 AT googlegroups DOT com> <52957941 DOT 9050203 AT iki DOT fi> <57ae09cc-bc48-4dcf-978d-9078096b2127 AT googlegroups DOT com> <bfnhrrF6qghU1 AT mid DOT dfncis DOT de> <82676ab0-7e81-4b89-bc7a-e3360d6c3b93 AT googlegroups DOT com> <201311281705 DOT rASH5KiD027835 AT envy DOT delorie DOT com>
In-Reply-To: <201311281705.rASH5KiD027835@envy.delorie.com>
Reply-To: djgpp AT delorie DOT com

This is a multi-part message in MIME format.
--------------030904060707070604030102
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

On 11/28/2013 07:05 PM, DJ Delorie wrote:
>> I found this:
>> https://groups.google.com/forum/#!topic/comp.os.msdos.djgpp/WeMjxnR1NBc
>> which seems to indicate that GCC will output non-386 opcodes anyway :-(
> Only for atomic operations, which are typically only used when
> threading, and DJGPP doesn't support threading.
I did check with simple script (see attachment) under Linux in cross-compiler
libstdc++ build directory (therefore i586-pc-msdosdjgpp-objdump)

For gcc-4.8.2 I'm getting:

[andris AT ap libstdc++-v3]$ sh x1
==================================================
./src/c++98/atomicity.o
    8:   f0 0f c1 02             lock xadd %eax,(%edx)
==================================================
./libsupc++/eh_ptr.o
   20:   f0 0f c1 43 a0          lock xadd %eax,-0x60(%ebx)
   11:   f0 0f c1 50 a0          lock xadd %edx,-0x60(%eax)
==================================================
./libsupc++/eh_throw.o
   12:   f0 0f c1 50 c0          lock xadd %edx,-0x40(%eax)
==================================================
./libsupc++/eh_tm.o
    f:   f0 0f c1 03             lock xadd %eax,(%ebx)

for last gcc snapshot I have built (gcc-4.9.0-20131206)

[andris AT ap libstdc++-v3]$ sh search486.sh
==================================================
./libsupc++/cp-demangle.o
     ce64:       0f cc                   bswap  %esp
==================================================
./src/c++98/atomicity.o
    8:   f0 0f c1 02             lock xadd %eax,(%edx)
==================================================
./libsupc++/eh_ptr.o
   21:   f0 0f c1 43 a0          lock xadd %eax,-0x60(%ebx)
   11:   f0 0f c1 50 a0          lock xadd %edx,-0x60(%eax)
==================================================
./libsupc++/eh_throw.o
   12:   f0 0f c1 50 c0          lock xadd %edx,-0x40(%eax)
==================================================
./libsupc++/eh_tm.o
    f:   f0 0f c1 03             lock xadd %eax,(%ebx)

Additionally atomicity is used for exampple in libstdc++-v3/src/c++98/ios_init.cc

xadd is available on 486+, so libstdc++ is unusable for 80386.

Andris


--------------030904060707070604030102
Content-Type: application/x-shellscript;
 name="search486.sh"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="search486.sh"

IyEgL2Jpbi9zaApzZWFyY2hfd29yZHM9ImJzd2FwIGNtcHhjaGcgeGFkZCIKc3JjX2ZpbGVz
PSQoZmluZCAuIC10eXBlIGYgLWEgLW5hbWUgJyoubycpCmZvciB3IGluICRzZWFyY2hfd29y
ZHMgOyBkbwogICAgZm9yIHggaW4gJHNyY19maWxlcyA7IGRvCiAgICAgICAgaWYgaTU4Ni1w
Yy1tc2Rvc2RqZ3BwLW9iamR1bXAgLS1kaXNhc3NlbWJsZSAkeCB8IGdyZXAgJHcgID5kaXNh
c20udG1wIDsgdGhlbgogICAgICAgICAgICBlY2hvICc9PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PScKICAgICAgICAgICAgZWNobyAkeAogICAg
ICAgICAgICBjYXQgZGlzYXNtLnRtcAogICAgICAgIGZpCiAgICBkb25lCmRvbmUK
--------------030904060707070604030102--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019