Jump to content

View more

Image of the Day

WIP title screen for #DeathOfAPartisan #screenshotsaturday #gamedev https://t.co/qJNhfZCvd4
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

How does one fix a structural hazard?

4: Adsense

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   

1535
Like
-2Likes
Like

Posted 20 December 2013 - 08:32 AM

How does one fix a structural hazard?



#2 Álvaro   Members   

20931
Like
5Likes
Like

Posted 20 December 2013 - 08:47 AM

*
POPULAR

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   

18221
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] [GitHub]


#4 Álvaro   Members   

20931
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   Members   

3587
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   

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