Humm, for a generic version, I'd probably go for rep mosvd + rep movsb for the last block. It works on all architectures, and works fairly well. This if of course from the assumption that "genenric memcpy's" would be moving small amount of data around - if you mainly use large memory blocks in your application, using one of the specialized versions could be a good optimization.
Posted on 2003-04-28 10:27:25 by f0dder
"... I'd probably go for rep mosvd + rep movsb for the last block."
Who cares about your stupid C/C++ opinion?
Just try to learn something about assembly from your friend scali
And please stop posting your blah-bla-bla, just assembly code if you can...
Here is an assembly forum rather then C/C++,VB etc
and don't turn into MadMaver
Posted on 2003-04-28 21:08:42 by lingo12
lingo, keep the tone friendly.

If writing a generic version to work across all architectures (well, we can assume 80386 w/FPU), and you've studied your code and found that you're mainly doing small blocks - what would you choose? When does the setup overhead of the bigblock routines become irrelevant because of the speed gain of the faster block moves?

I wasn't saying "use rep movsd for all" - it's nice having efficient routines for large copies. I was commenting on "BTW, what would you all use for a 'general' version? I'm willing to assume PII+.", _and_ in the context of my usage patterns.
Posted on 2003-04-29 01:49:05 by f0dder

lingonaza, how long till your next ban? :grin:

PS: are you 1.2 years old? Ya know, you can use the dot in the nickname, it's not that you're forced to claim 12. :grin:
Posted on 2003-04-29 03:30:17 by Maverick
please guys keep it friendly and at your respective ages.
It's a nice thread it doesn't deserve to be derailed like this.
Posted on 2003-04-29 05:25:40 by Hiroshimator

please guys keep it friendly and at your respective ages.
It's a nice thread it doesn't deserve to be derailed like this.
Yeah, the kid some posts ago while insulting f0dder called me "MadMaver" without me ever having written anything in this thread before. They should forbid Internet connection from elementary schools.
Posted on 2003-04-29 07:38:05 by Maverick

"... I'd probably go for rep mosvd + rep movsb for the last block."
Who cares about your stupid C/C++ opinion?
Just try to learn something about assembly from your friend scali
And please stop posting your blah-bla-bla, just assembly code if you can...
Here is an assembly forum rather then C/C++,VB etc
and don't turn into MadMaver


What's that ?
Personally, I care about his not-so-stupid C/C++ opinion like you name it. I also think that every programmer opinion here is important.
If you came here to say things like "I have a bigger cock than you because I code in assembly" it seems that you may have missed the purpose of a messageboard...
Posted on 2003-04-29 08:15:18 by JCP
I wonder if anyone has forgotten that this used to be the win32asm forum ?

I guess we can now all wait with baited breath for the optimised VB code to start turning up. :grin:

Regards,

hutch@movsd.com
Posted on 2003-04-29 09:05:26 by hutch--
Win32ASM forum has never been a place for programmers with a oversized ego that just want to show their "assembly power" to the poor HLL programmers. I posted because lingo's behaviour pissed me off, not to start another sterile HLL vs ASM debate.

And don't talk about VB code, we all know you can't dig C but then do not compare it with other languages you also don't use, as VB... you simply don't have experience in these fields to make such statements.

And please give up this bad habit to make everything turn to a HLL vs ASM debate and take every opportunity to flame f0dder : by doing this, you only make his point more true to everyone, starting by myself.
Posted on 2003-04-29 09:43:14 by JCP
Jean,

thanks for the lecture, if I ever bother to record it and print it, it will be on toilet paper.

Funny enough this used to be the win32asm forum, I wonder what you have in mind instead, win32asp ?

As I was writing C when you were in napkins, your comment may be a little misplaced but I am sure you means well with it.

=================================
And please give up this bad habit to make everything turn to a HLL vs ASM debate and take every opportunity to flame f0dder : by doing this, you only make his point more true to everyone, starting by myself.
=================================

Now perhaps you have not read the post but I did not have to mention anyone so you are going off half loaded again. Hear the voice of dissent from other members and take notice.

I will forgive the comment "bad habit" because you are likable. :tongue:

Regards,

hutch@movsd.com
Posted on 2003-04-29 12:04:21 by hutch--
Just for the record, I wasn't bring C into this debate - lingo was. If you're going to ruin yet another thread, go ahead. I won't answer back.
Posted on 2003-04-29 12:25:29 by f0dder
let's analyze the situation but let's first state some facts:

1. f0dder prefers HLL(considering his post at the crusades) ... like a majority of everybody including me but also codes in assembly. :grin:
2. the mindset when coding in assembly is tight code, optimized routines, never settles anything less than the best (repeat this 100x times to understand the mindset of other programmers)

now when f0dder suggested rep movsd/movsb he's saying "for compatibility, I'll just settle with simple instructions rather than the MMX/SSE versions which requires p3++.

this kind of thinking can be paralleled to "I'll just settle with HLL for compatibility rather than ASM for the best"

now there is nothing wrong with personal preferences... I believe this war has erupted due to clashes of preferences.

probably fueled by something bad from an older flame war or a negative perception from an older posts/threads or something... this has now erupted to another flamewar.

;) :grin:

I'll leave before I get burned... :grin:


Posted on 2003-04-29 13:17:10 by arkane
hrm, I don't see why my initial post had to be moved along with the rest, but splitting up is a good idea. I'm sick of people poisoning threads.

Arkane, while I personally think your point #2 is true, a lot of people program in assembly for other reasons - peace be with them.

As for "rep movsd" - again, this would be for a generic memory copy. And again, this would be from the observation of my personal code (and on top of that, much other code from various sources), that most occasions where a generic memory copy is done, you will be working on small memory blocks. Thus, you'd probably (correct me if I'm wrong) spend too much time handling "special case" in a large-block-size-optimized routine.

Already in my first post, I stated:

if you mainly use large memory blocks in your application, using one of the specialized versions could be a good optimization.

Of course there's reason for using an optimized routine where it matters (framebuffers, whatever). I'm still saying that - for my usage patterns - substituting my general memory copy with a large-block-size would be shooting myself in the foot. This observation holds true both for my C code and my Asm code.

I don't see how this has anything to do with C vs. Asm, I don't see why lingo (bulianazi?) has to post shit, nor any of the other crap. Splitting off the pointless flame war is a good idea, but I don't get why my initial post had to be moved as well (except perhaps to avoid further flames).
Posted on 2003-04-29 13:31:38 by f0dder
personally, I don't find your rep movsd/movsb bad because I think it's short, slick, easy and does the job plus the compatibility with older processors.

It's the preferences I tell ya. ;) this sounds like a windows vs. linux type of threads. ;)
Posted on 2003-04-29 13:35:57 by arkane

It's the preferences I tell ya. ;) this sounds like a windows vs. linux type of threads. ;)

Heh yeah... linux vs. window usually has extreme amount of subjectivity and not much technical stuff and a lot of trolling... at least I _assume_ there's some overhead with the large-block-size versions that make them suboptimal for small copies.
Posted on 2003-04-29 13:40:14 by f0dder
thanks for the lecture, if I ever bother to record it and print it, it will be on toilet paper.


It is not a secret that every thing we tell you end up in your ass...

As I was writing C when you were in napkins, your comment may be a little misplaced but I am sure you means well with it.


It is funny how you deal with any people not agreeing with you : "you are just a little child", as usual...
Your experience of C is maybe from the time I were in napkins but things much changed now and I don't think you are aware of it...

Nobody is talking about making a Win32ASP forum (asp has nothing to do with C, by the way) there, so what are you talking about ?
Always your bad habit to make a ASM vs HLL debate...
Posted on 2003-04-29 16:57:49 by JCP
Readiosys,
"Win32ASM forum has never been a place for programmers with
a oversized ego that just want to show their "assembly power"
to the poor HLL programmers.
"

Emotional and Wrong!

Win32ASM forum has ever been a place for assembly programmers
to show the power of assembly to the HLL programmers
Just take a look at "Algorithms & Source Code" section
It is the main reason making the board unique!


"If you came here to say things like "I have a bigger cock than you
because I code in assembly""
I have working projects in C/C++, Pascal and COBOL too...and
for your info: when I code my cock is not so big


"Personally, I care about his not-so-stupid C/C++ opinion like you name it."
There are other excellent C/C++ boards

"I also think that every programmer opinion here is important."
I like the constructive critics too, but... (see bellow)




f0dder,
"hrm, I don't see why my initial post had to be moved along with the rest,
but splitting up is a good idea. I'm sick of people poisoning threads."

Who poisons threads?

If someone spends the time and efforts to post optimized assembly code,
people like you poison his thread with:

"... I'd probably go for rep mosvd + rep movsb for the last block." by f0dder
That means "Your code is useless" due to the subject of the thread is about MMX code
Where is YOUR OPTIMIZED code to proof your opinion?
Where is your "help" here? Does the author deserve this?
If you can't correct his OPTIMIZED MMX ASSEMBLY code just skip the thread

There are some normal feedbacks as:
"Congratulations!.." by Hutch..

It is a normal answer to stimulate the author to continue to post

"Just go to read other's code and compare with your code" by Nexo

It is a normal example of constructive critics etc.


Other example:
"RealMen? More like RealWasteOfTime. It can be beneficial to know how to do it, but coding in hex? Useless." by f0dder

and normal assembly answer:

"I'll proof it to you, you're wrong. Remember, the HLL coder think programming on Asm is useless and annoying too.
But we know it was not. " by realvampire


Other example: "I've just compiled the C function to assembly and included that to my assembly program."
by MadMaver


Other example: I can continue but I'm not a jobless and have a family too

Regards,
Lingo
Posted on 2003-04-29 19:46:17 by lingo12

Win32ASM forum has never been a place for programmers with
a oversized ego that just want to show their "assembly power"
to the poor HLL programmers. "

Emotional and Wrong!

Win32ASM forum has ever been a place for assembly programmers
to show the power of assembly to the HLL programmers
Just take a look at "Algorithms & Source Code" section
It is the main reason making the board unique!


As a moderator here for a long time, you are probably not going to say me what this board is about... assembly programming in a peaceful way : I don't think flamming f0dder just because he evocates the word "C" is something very peaceful...
HLL programmers have no need to be convinced of the power of assembly... most of the advanced HLL people here also have a background in assembly.
You also flame "MadMaver", like you call him... but let me guess : he also is a hateful HLL programmer that's this ?
What makes this board unique is the way they talk about things... unfortunaly it tends to disappear due to the oversized ego of some programmers...

Contribute here like f0dder and Maverick did, it will be a good start...
Posted on 2003-04-30 01:15:03 by JCP
lingo... it seems like you got stuck on the "rep movsd" and didn't read any further. I was saying "for a generic" version, and added that it was from the assumption that a "generic" version would move small blocks mainly. Now, I may be wrong, and feel free to correct me, but is it not correct that routines optimized for large blocks usually need a minimum size before they perform well?

Furthermore, already in the first post, I had a "if you mainly use large memory blocks in your application, using one of the specialized versions could be a good optimization.".

It was you who popped in and poisoned the thread.
Posted on 2003-04-30 02:06:01 by f0dder

While touching himself and watching some pr0n, lingo12 wrote:
Other example: "I've just compiled the C function to assembly and included that to my assembly program."
by MadMaver
You're an idiot, bulianaza / lingo / your_next_silly_name_after_you'll_get_banned_again

For those interested on putting in context that phrase, the thread is this and the whole phrase I wrote was :


Only if you consider C like God's solution.

Personally, when I've been asked to write something and I was given a C function to be included (and write the rest), I've just compiled the C function to assembly and included that to my assembly program.

[ SO, YOU PIECE OF DAMN IDIOT BULIANAZA/LINGO, I WENT MORE PRO-ASM THAN IF I INSTEAD ADDED ASM TO MY EMPLOYER'S C SOURCE, SO PROVING THE OPPOSITE OF WHAT YOU FALSELY TRYED TO PROVE ]

So, inline assembly in a C program can be as well replaced to inline C into an assembly program.

Still, even in C it doesn't make sense to waste time optimizing e.g. the code around a call to ReadFile that has to read a 10 MB file.

Time is too precious to be wasted like that, considering all the more important parts that need optimizations.

No, this doesn't translate to it's better to code in C and add some inline asm, that's a whole other matter.

That's what I wrote, and into a specific context.

In any case, what did you want to demonstrate dumbo12, that you are lamer more than before? I already blowed you in pieces here, you didn't have enough of it already, you poor masochist bastard? :grin:

Other example: I can continue but I'm not a jobless and have a family too
Yeah, you have a family.. go to your mommy, bimbo12, and keep uselessly optimizing the code around ExitProcess to escape from the real challenges..

Somebody oughta ban this idiot again, he ruins the atmosphere of this otherwise wonderful board.
Then, some months later, another lamer will appear with the nick ass13, he will throw on our faces all of his silly complexes and ego, and new useless flamewars will start on the board again.

What a shameful waste of time..
Posted on 2003-04-30 02:47:25 by Maverick