Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Things that are hard about compiling to x86

Name: Anonymous 2015-07-30 0:16

It is really hard to compile arithmetic to x86 assembly because:

* (A) add x,y requires at least one of x,y to be a register.
* (B) mul x is predefined to use eax and edx registers.

These make it hard when you're trying to do register allocation because

* (A) What if you spilled x and now need to spill y? You cannot spill both
* (B) This messes with register coloring, you want to precolor the graph but the polytime algorithms (for chordal graphs, which SSA has) break if you precolor.

I'm really stuck, any advice welcome

Name: Anonymous 2015-08-04 11:41

Stacks destroy instruction level parallelism.

Name: Anonymous 2015-08-05 14:12

>>41
thank you for this interesting input.

It really feels like there is just no simple satisfying way to do register allocation.

I don't mind heuristics, I get that we need them because everything is NP otherwise. I just hate iterated spilling.. it's too hard to justify its' termination and correctness. the beautiful algorithms don't apply to the general case (like x86's weirrdness).

I'ts reoaelly frustrating because i just want to get i tdone but I can't at all settle on a design.

Name: Anonymous 2015-08-05 18:26

>>42
Constraint satisfaction.

Name: Anonymous 2015-08-05 20:22

>>43
would be nice if you'd elaborate

i've considered that but i don't see how it gets you anywhere, it's just a different notation really

Name: Anonymous 2015-08-05 23:26

>>44
Once you set up a problem as a constraint satisfaction problem, you can try to solve it with brute force. If the constraints are not satisfiable, you can try solving it with looser constraints by allowing one or a few of the variables to spill. Doing it this way it's easy to express the weird register constraint with mul and div. Brute force might not be so bad since the number of registers is small.

Name: Anonymous 2015-08-06 13:43

>>45
so if i have 8 registers it'll be O(8^n) with n the number of lifetimes? that's not going to terminate in this universe

Name: Cudder !cXCudderUE 2015-08-06 14:36

>>42
Another brainwashed ivory-tower academic... no wonder you can't figure it out. You're the retard here.

I bet you can't even write good Asm with your brain... so what makes you think you can write a compiler if you haven't ever written any significant amount of Asm? If you did, you'd know how to do register allocation already.

Name: Anonymous 2015-08-06 14:37

>>47
Hi there!

You seem to have made a bit of a mistake in your post. Luckily, the users of /prog/ are always willing to help you clear this problem right up! You appear to have used a tripcode when posting, but your identity has nothing at all to do with the conversation! Whoops! You should always remember to stop using your tripcode when the thread it was used for is gone, unless another one is started! Posting with a tripcode when it isn't necessary is poor form. You should always try to post anonymously, unless your identity is absolutely vital to the post that you're making!

Now, there's no need to thank me - I'm just doing my bait to help you get used to the anonymous text-board culture!

Name: Anonymous 2015-08-06 14:41

>>48
identity has nothing at all to do with the conversation
Cudder is talking about ASM, of course it has to do with his identity.

Name: Anonymous 2015-08-06 14:49

yes keep posting without name, thank you.

Name: Anonymous 2015-08-06 14:53

Cudder is not my car

Name: Anonymous 2015-08-06 15:59

>>48
I wish you would use a tripcode. That way it would be easy to filter you.

Name: Anonymous 2015-08-06 18:01

>>52
tripcode defense force please go

Name: Anonymous 2015-08-06 19:53

>>46
Not really. For example if there is a mul instruction, there's only two choices. And you don't need to go through all of them you just need to find one that works.

>>48
You mean imageboard culture. text board culture is more similar to useneet. Get with it anon-kun.

Name: Anonymous 2015-08-06 19:57

>>48
Hi there!

You seem to have made a bit of a mistake in your post. Luckily, the users of /prog/ are always willing to help you clear this problem right up! You appear to have used a imagereddit meme when posting! Whoops! You should always remember to stop using imagereddit memes when the board you are posting in is a textboard! Posting with a imagereddit meme when it isn't necessary is poor form. You should always try to post following the culture of the site, unless your memes are absolutely vital to the post that you're making!

Now, there's no need to thank me - I'm just doing my best to help you get used to the text-board culture!

Name: Anonymous 2015-08-06 22:22

>>47
Another brainwashed ivory-tower academic
Sounds like he's an educated stupid, in fact, you could say he's an EDUCATED SINGULARITY IDIOT WHO CAN STUPIDLY DENY NATURE'S HARMONIC 4 SIMULTANEOUS 24 HOUR DAYS WITHIN A SINGLE ROTATION OF EARTH. HE HAS A CYCLOP PERSPECTIVE AND TAUGHT ANDROID MENTALITY = LOBOTOMIZED ANALYTICAL ABILITY. EDUCATORS ALTERED HIS MIND. HE CANNOT THINK OPPOSITE OF WHAT HE WAS TAUGHT TO THINK. WILL I GET A REPLY OR WILL THE WISEST HUMAN JUST BE IGNORED UNTIL SILENCED BY DEATH?

Name: Anonymous 2015-08-07 7:56

>>55
Hi there!

You seem to have gotten dubs with your post. Luckily, the users of /prog/ are always willing to check your dubs right up! You appear to have gotten a post number ending in repeating digits when posting! Great! We will always remember to check your dubs when the board you are posting in is a textboard! Posting with a dubs when it is always necessary is great form. We will always try to check your dubs following the culture of the site, since your dubs are absolutely vital to the post that you're making!

Now, there's no need to thank us - we're just doing our best to help your GET in the text-board culture!

Name: Cudder !cXCudderUE 2015-08-07 11:46

>>56
ANDROID MENTALITY
Better than iOS, in any case...

Name: Anonymous 2015-08-07 13:27

>>58
iOS is definitely better written and better designed. On Android, you can't even get the main internal memory directory that your app is given permission to without causing a race condition and having a null pointer exception bring the whole thing dowb.

Name: Anonymous 2015-08-07 14:00

>>58
Not that I like Apple much, but the Android API is complete and utter shit.

Name: just JR 2015-08-07 23:26

>>2-60
fuck off, cudder. fuck off, cudder. fuck off, cudder.

Name: Anonymous 2015-08-08 0:36

>>61
fuck off, /g/, fuck off, /g/, fuck off, /g/

Name: Cudder !cXCudderUE 2015-08-08 6:58

>>59,60
I'm not praising Android much; Java is a bloody bloated mess, but closed-source walled gardens are a much bigger problem.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List