flat assembler
Message board for the users of flat assembler.

Index > Main > Expertise needed to convert C to assembly

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
PeExecutable



Joined: 26 Jun 2015
Posts: 181
PeExecutable
Basically, we need your education redsock, there are many here who are better than you for sure, but do not let your fears drive you. Quite often, when someone corrects you, you'll feel bad one second, one minute or one day, but after a week you'll appreciate that there were people correcting you. So don't let the fear of "more competent people" scare you away. We need your expertise. And of course, we'll respect that confidentiality. I have a very good instinct when it comes to programmers and I know you're very competent in optimization. There is just one missing link, we people need to learn and when nobody want to share their code nobody can really learn from the best Crying or Very sad
Post 30 Jul 2015, 12:57
View user's profile Send private message Reply with quote
redsock



Joined: 09 Oct 2009
Posts: 364
Location: Australia
redsock
PeExecutable wrote:
Basically, we need your education redsock, there are many here who are better than you for sure, but do not let your fears drive you. Quite often, when someone corrects you, you'll feel bad one second, one minute or one day, but after a week you'll appreciate that there were people correcting you. So don't let the fear of "more competent people" scare you away. We need your expertise. And of course, we'll respect that confidentiality. I have a very good instinct when it comes to programmers and I know you're very competent in optimization. There is just one missing link, we people need to learn and when nobody want to share their code nobody can really learn from the best Crying or Very sad
Perhaps I gave you more credit than you deserve. we didn't need help, you did.

If mockery were a useful tactic, you'd have high marks.

Test data and output requirements ready?
Post 30 Jul 2015, 13:04
View user's profile Send private message Reply with quote
PeExecutable



Joined: 26 Jun 2015
Posts: 181
PeExecutable
I have not really thought about what kind of requirements will be used, my personal thought is to store it away for later use, it's basically, just to test when points are inside polygons. Probably a lot of polygons, primarily convex polygons.

What if I let you decide the output requirements to the best ability you can think will be the best for future use, basically just for testing points inside polygons.

Well thats it, I have to go code now.


Last edited by PeExecutable on 30 Jul 2015, 14:17; edited 1 time in total
Post 30 Jul 2015, 13:10
View user's profile Send private message Reply with quote
redsock



Joined: 09 Oct 2009
Posts: 364
Location: Australia
redsock
PeExecutable wrote:
I have to go code now.
May all your dreams come true, mate.
Post 30 Jul 2015, 13:14
View user's profile Send private message Reply with quote
PeExecutable



Joined: 26 Jun 2015
Posts: 181
PeExecutable
The forum is ageing, as everything must do. (If you visit your grandparents in the elders home and you help them and feed them with a spoon of soup, they just push it away with a stiff lip, with very little enthusiasm for life anymore, they keep their toothbrush stuck inside the hand, if you try to grab it, it wont move)

Thanks for the tip, my dreams are coming true, but the goal is not the dream, it's the way. Very Happy

(...I don't like the ageing thing, seek the spring before its too late, it's starting to look very grey already and everything is unpleasantly dried up)
Post 30 Jul 2015, 14:20
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 619
cod3b453
Well as precalc_values is a simple loop, you can start with the corresponding (v){and|cmp|div|mul|or|sub}ps instructions to do 4/8/16 parallel operations for SSE or AVX and use cpuid to determine the best available extensions to select one of multiple implementations, if performance is really critical. This already makes assumptions that your buffer is a multiple of these values; if not, you'll need more code to handle/pad it.

Before you do this, it may help to restructure your C code to extract each repeated subcomponent into an intermediate variable e.g. "A=polyY[j]-polyY[i]" and substitute A/etc everywhere it's used; this should help with translation. When implementing, try to interleave non-interdependent operations.

So far, all of this is pretty generic to any parallel optimisation; anything further starts to be very specific to the application and system. It may be possible to rearrange and eliminate the divides in precalc_values by modifying pointInPolygon so that "y*multiple[i]+constant[i]<x" becomes "y*(polyX[j]-polyX[i])+(polyX[i]*(polyY[j]-polyY[i]))-(polyY[i]*polyX[j])+(polyY[i]*polyX[i]) < x*(polyY[j]-polyY[i]);" and so on.
Post 30 Jul 2015, 22:21
View user's profile Send private message Reply with quote
PeExecutable



Joined: 26 Jun 2015
Posts: 181
PeExecutable
Thanks cod3b453.

I'm an avoider by nature, I like optimizing simply by avoiding anything that can be avoided, after anything can be avoided, I try to find things that can be avoided in its practical use, when that is avoided also, I go more specific into the code and see what can be done there.

I strongly believe in code layout and design and in avoiding anything that can be avoided, especially memory writes, I avoid writes whenever possible. After all of that I focus on "eating" in parallell so more can be done in shorter amount of time, after that it comes down to efficient cache usage and then instruction optimization. (After a good algorithm has been implemented)
Post 03 Aug 2015, 20:13
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< 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 cannot 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.