The above code depends on quirks of the compiler to

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: .32 we show just a single form of the subtraction operation fsub. In fact, this operation comes in 182 CHAPTER 3. MACHINE-LEVEL REPRESENTATION OF C PROGRAMS many different variants, as shown in Figure 3.33. All compute the difference of two operands: ÇÔ ½ ÇÔ ¾ and store the result in some floating-point register. Beyond the simple subp instruction we considered for the hypothetical stack evaluator, IA32 has instructions that read their second operand from memory or from some floating-point register other than %st(1). In addition, there are both popping and nonpopping variants. The first group of instructions reads the second operand from memory, either in single-precision, double-precision, or integer format. It then converts this to extended-precision format, subtracts it from the top stack element, and overwrites the top stack element. These can be seen as a combination of a floating-point load following by a stack-based subtraction operation. The second group of subtraction instructions use the top stack element as one argument an...
View Full Document

Ask a homework question - tutors are online