This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: LSU EE 4720 Homework 1 Solution Due: 11 February 2005 Problem 1: POWER is an IBM ISA developed for engineering workstations, PowerPC is an ISA developed by IBM, Apple, and Motorola for personal computers and is based on POWER. POWER and PowerPC have instructions in common but each has instructions the other lacks (and some of the common instructions behave differently). Therefore a POWER implementation could not run every PowerPC program and vice versa. ( a ) Show the gcc 3.4.3 compiler switches used to compile code for a POWER implementation. Hint: Google is your friend, look for gcc documentation. Either of the following switches compiles for a generic POWER implementation -mpower, -mcpu=power. The compiler can also be told to target a particular implementation, for example, -mcpu=rios2. ( b ) Show the gcc 3.4.3 compiler switches used to compile code for a PowerPC implementation. Either of the following switches compiles for a generic PowerPC implementation -mpowerpc, -mcpu=powerpc. The compiler can also be told to target a particular implementation, for example, -mcpu=620 ( c ) Is it possible to use gcc 3.4.3 to compile a program that will run on both? If yes, show the switches. Yes, one way is to specify two switches: -mno-power -mnopowerpc, the other uses the single switch -mcpu=common....
View Full Document
- Spring '08