ps1-sol - ECE 468 Problem Set 1: Compiler basics...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ECE 468 Problem Set 1: Compiler basics [Solutions] 1. Consider a machine with no branch predictors ( i.e. , the hardware does not use past behavior to tell whether a branch will be taken or not taken). Instead, the machine’s ISA allows a compiler to set a flag on each branch indicating if the branch is usually taken or usually not taken. Which kind of compiler would you expect to perform better for this machine: a static compiler (like gcc)? Or a just-in-time compiler? Explain. Answer: In this question, I was looking more for a justification for your answer, rather than one specific answer. One answer is that since branch prediction is a fundamentally dynamic task, and is often input-dependent ( i.e. , whether a branch is taken or not depends on the particular input that you give to a program), a just-in-time compiler will do better, as it will be able to take into account the actual behavior before setting the taken/not-taken flag for a branch. Conversely, you could argue that a static compiler like gcc might fare better because any time you have to offload more...
View Full Document

This note was uploaded on 02/19/2012 for the course ECE 468 taught by Professor Test during the Fall '08 term at Purdue.

Page1 / 2

ps1-sol - ECE 468 Problem Set 1: Compiler basics...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online