flat assembler
Message board for the users of flat assembler.

Index > Heap > HLLs suck!

Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
Author
Thread Post new topic Reply to topic
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Looks like a cdecl call adjusting the stack although unneeded. I wonder if it is actually an optimization for Core 2 because of the so called 6.7 Stack engine
Post 28 Nov 2009, 04:14
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
I've got a copy of that DLL. In the attachment you can see the list of addresses where the same add-mov sequence can be found.

After re-reading the Stack Engine stuff I'm not so sure it has a chance to be an optimization but sure thing is that if it is not then recent compilers have involuted or the DirectX dev team forgot to enable some optimizations... (maybe a debug build?)


Description:
Filesize: 13.89 KB
Viewed: 7101 Time(s)

RedundantAdd.PNG


Post 28 Nov 2009, 19:19
View user's profile Send private message Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu
I'm not sure how this could make it easier to debug, but okay. o_o

_________________
Post 28 Nov 2009, 19:24
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
asmfan



Joined: 11 Aug 2006
Posts: 392
Location: Russian
asmfan
Stack balancing in x32 stdcall is a mess which x64 has dropped.
But in this case < add esp,12 / mov esp, ebp > it's not harmful cuz between could go smth. else like another call or other code. But stack have to be balanced after every call either by callee (proc itself) or by caller. Why if internal c-call it was? HLL can easily compete in speed/size with mean asm programmer and often outperform him/them.
Post 29 Nov 2009, 15:30
View user's profile Send private message Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu
asmfan wrote:
HLL can easily compete in speed/size with mean asm programmer and often outperform him/them.
As evidenced by its crowning achievement of.. "add regA,X mov regA,Y"! Quite the pinnacle of optimization. Laughing

_________________
Post 29 Nov 2009, 15:51
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Fanael



Joined: 03 Jul 2009
Posts: 168
Fanael
asmfan wrote:
HLL can easily compete in speed/size with mean asm programmer and often outperform him/them.
Yep. However, the opposite is also true.
Post 29 Nov 2009, 18:54
View user's profile Send private message Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2466
Location: Bucharest, Romania
Borsuc
If you don't think in asm, HLL code would be shit not because of compiler, but because of you telling it to do something in a stupid way (algo).
Post 29 Nov 2009, 19:38
View user's profile Send private message Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu
Borsuc wrote:
If you don't think in asm, HLL code would be shit
And if you do, you don't need HLLs. Catch 22!

_________________
Post 29 Nov 2009, 19:42
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 764
Location: Massachusetts, USA
bitshifter
So in this day and age would C be considered a low level language?
Post 29 Nov 2009, 20:30
View user's profile Send private message Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu
By .NETers maybe.

_________________
Post 29 Nov 2009, 20:33
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Azu: Care to share some bigger piece of code of yours, so that we can see how well do you compete with MSVC optimizer? Only one that I found was one with ".while TRUE" here.
Post 29 Nov 2009, 21:13
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu
vid wrote:
Azu: Care to share some bigger piece of code of yours, so that we can see how well do you compete with MSVC optimizer?


Here;
Code:
mov     esp, ebp    



Much smaller and faster than the HLL's version!

Oh wait.. you said bigger.
Hmm.
How about this?
Code:
add esp,1
add esp,1
add esp,1
add esp,1
mov esp,ebp    

vid wrote:
Only one that I found was one with ".while TRUE" here.
That's not my code.
I don't know who's it was.
I just wanted to compile it.
Also, I made that topic as I was just starting to learn assembly, so not quite a fair comparison to the end result of decades of HLL evolution.

_________________
Post 29 Nov 2009, 21:32
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Fanael



Joined: 03 Jul 2009
Posts: 168
Fanael
vid wrote:
Azu: Care to share some bigger piece of code of yours, so that we can see how well do you compete with MSVC optimizer?
Why MSVC optimizer and not Intel's or GCC's? These two are better.

Bah, 69th post Smile
Post 29 Nov 2009, 21:40
View user's profile Send private message Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu
Fanael wrote:
vid wrote:
Azu: Care to share some bigger piece of code of yours, so that we can see how well do you compete with MSVC optimizer?
Why MSVC optimizer and not Intel's or GCC's? These two are better.
I guess because the code in question came from MSVC.


Also, I thought GCC and MSVC were on fairly even footing?

_________________
Post 29 Nov 2009, 21:42
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
Fanael wrote:
vid wrote:
Azu: Care to share some bigger piece of code of yours, so that we can see how well do you compete with MSVC optimizer?
Why MSVC optimizer and not Intel's or GCC's? These two are better.
Perhaps if you're comparing against VC6... which would be kinda silly since that compiler is 11 years old.

_________________
Image - carpe noctem
Post 29 Nov 2009, 21:48
View user's profile Send private message Visit poster's website Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu
f0dder wrote:
Fanael wrote:
vid wrote:
Azu: Care to share some bigger piece of code of yours, so that we can see how well do you compete with MSVC optimizer?
Why MSVC optimizer and not Intel's or GCC's? These two are better.
Perhaps if you're comparing against VC6... which would be kinda silly since that compiler is 11 years old.
[offtopic]How good are current versions of GCC at compiling 11 year old GCC projects compared to current versions of MSVC at compiling VC6 projects?[/offtopic]

_________________
Post 29 Nov 2009, 21:51
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
There's no such thing as "GCC projects" - but compiling 11 years old code shouldn't, by itself, be a problem (unless you use a lot of specific GCC compiler options). The biggest problem, for programs bigger than hello-world size Smile, would very likely be finding (and buildling...) the correct old library versions since interfaces have changed in some libraries.
Post 29 Nov 2009, 21:57
View user's profile Send private message Visit poster's website Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu
f0dder wrote:
There's no such thing as "GCC projects" - but compiling 11 years old code shouldn't, by itself, be a problem (unless you use a lot of specific GCC compiler options). The biggest problem, for programs bigger than hello-world size Smile, would very likely be finding (and buildling...) the correct old library versions since interfaces have changed in some libraries.
So basically;
If you have code for the old version of GCC (and the libraries that go with it) nothing stops you from compiling it in new GCC versions.

But old MSVC projects are incompatible with new versions of MSVC, so it makes sense to take into account how much old versions of MSVC suck.
Thus, it is fair to make comparisons to VC6.

_________________
Post 29 Nov 2009, 22:00
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Quote:
Oh wait.. you said bigger.
Hmm.
How about this?
Code:
add esp,1 
add esp,1 
add esp,1 
add esp,1 
mov esp,ebp    


Well, it is truth that 5 lines is probably the biggest piece of your own code that you ever posted here, but I meant "bigger" in common sense. Like, some application that actually does something, besides calling bunch of APIs.

Quote:
But old MSVC projects are incompatible with new versions of MSVC, so it makes sense to take into account how much old versions of MSVC suck.

Do you know that, or do you just think that?
Post 29 Nov 2009, 22:15
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
Azu: newer versions of Visual Studio can convert old projects/solutions to the newer format - I haven't had problems doing that (disclaimer: the solutions I've converted haven't been huge). There's some potential problems because of compiler bugs, but the only one I've run into has been scope-bug-with-variable-declaration-in-for-statement, and you usually only see that in crap code you don't want to be using anyway - and it's simple to fix.
Post 29 Nov 2009, 22:17
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.