Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


How does one fix a structural hazard?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 warnexus   Prime Members   -  Reputation: 1450

Like
-2Likes
Like

Posted 20 December 2013 - 08:32 AM

How does one fix a structural hazard?



Sponsor:

#2 Álvaro   Crossbones+   -  Reputation: 13645

Like
5Likes
Like

Posted 20 December 2013 - 08:47 AM

10 seconds on Google: http://en.wikipedia.org/wiki/Classic_RISC_pipeline#Structural_hazards

 

With the amount of detail in your question, I don't think anyone can do better than that.

 

Now for the more important part of my answer: How does this relate to game programming? You seem to be using this board as some general tool to enrich your learning about CS, but that's not what it is for, so please stop doing it.



#3 swiftcoder   Senior Moderators   -  Reputation: 10231

Like
0Likes
Like

Posted 20 December 2013 - 09:30 AM


Now for the more important part of my answer: How does this relate to game programming? You seem to be using this board as some general tool to enrich your learning about CS, but that's not what it is for, so please stop doing it.

This is the "General Programming" forum, so the question isn't off-topic.

 

It is however hopelessly vague. I'd much prefer it if more specific questions were asked...


Tristam MacDonald - Software Engineer @Amazon - [swiftcoding]


#4 Álvaro   Crossbones+   -  Reputation: 13645

Like
0Likes
Like

Posted 20 December 2013 - 10:01 AM

I think it's still off-topic. As far as I can tell, structural hazard is a term in processor design, not programming.



#5 Adam_42   Crossbones+   -  Reputation: 2562

Like
1Likes
Like

Posted 20 December 2013 - 01:13 PM

It's kind of programming, if you're writing assembly on certain processors (PPC ones spring to mind) you will want to avoid structural hazards as they tend to cause pipeline stalls.

 

Avoiding them is usually best left to the compiler though, the comments in this bit of code explain one way to avoid them. https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_22/lib/Target/PowerPC/PPCHazardRecognizers.cpp



#6 King Mir   Members   -  Reputation: 2031

Like
1Likes
Like

Posted 20 December 2013 - 01:27 PM

Broadly speaking, you avoid structural hazards by intermixing memory, integer, and floating point code in inner loops, instead of having separate loops for each. But this is very much a micro-optimization.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS