Главная » Просмотр файлов » Volume 1 Basic Architecture

Volume 1 Basic Architecture (794100), страница 53

Файл №794100 Volume 1 Basic Architecture (Intel and AMD manuals) 53 страницаVolume 1 Basic Architecture (794100) страница 532019-04-28СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 53)

These encodings are no longer supported due tochanges made in the final version of IEEE Standard 754 that eliminated these encodings.Specifically, the categories of encodings formerly known as pseudo-NaNs, pseudoinfinities, and un-normal numbers are not supported and should not be used asoperand values. The Intel 387 math coprocessor and later IA-32 processors generatean invalid-operation exception when these encodings are encountered as operands.Beginning with the Intel 387 math coprocessor, the encodings formerly known aspseudo-denormal numbers are not generated by IA-32 processors.

When encountered as operands, however, they are handled correctly; that is, they are treated asdenormals and a denormal exception is generated. Pseudo-denormal numbersshould not be used as operand values. They are supported by current IA-32 processors (as described here) to support legacy code.8-20 Vol. 1PROGRAMMING WITH THE X87 FPUTable 8-3. Unsupported Double Extended-Precision Floating-Point Encodings andPseudo-DenormalsClassPositivePseudo-NaNsBiased ExponentIntegerFraction0.011..11.11..110Quiet11..11.10..000.011..11.11..110Signaling01..11.00..01011..11000..000.011..10.00..01011..11.00..00Pseudo-denormals0.000..00.00..00111..11.00..00Pseudo-denormals1.100..00.00..00111..11.00..001.111..10.00..010Unnormals11..01.00..00Pseudo-infinity111..11000..001.111..11.11..110Signaling01..11.00..011.111..11.11..110Quiet11..11.10..00Positive Floating Pseudo-infinityPointUnnormalsNegativeFloating PointNegativePseudo-NaNs← 15 bits →8.3SignificandSign← 63 bits →X86 FPU INSTRUCTION SETThe floating-point instructions that the x87 FPU supports can be grouped into sixfunctional categories:••••Data transfer instructionsBasic arithmetic instructionsComparison instructionsTranscendental instructionsVol.

1 8-21PROGRAMMING WITH THE X87 FPU••Load constant instructionsx87 FPU control instructionsSee Section 5.2, “x87 FPU Instructions,” for a list of the floating-point instructions bycategory.The following section briefly describes the instructions in each category. Detaileddescriptions of the floating-point instructions are given in the Intel® 64 and IA-32Architectures Software Developer’s Manual, Volumes 3A & 3B.8.3.1Escape (ESC) InstructionsAll of the instructions in the x87 FPU instruction set fall into a class of instructionsknown as escape (ESC) instructions. All of these instructions have a common opcodeformat, where the first byte of the opcode is one of the numbers from D8H throughDFH.8.3.2x87 FPU Instruction OperandsMost floating-point instructions require one or two operands, located on the x87 FPUdata-register stack or in memory.

(None of the floating-point instructions acceptimmediate operands.)When an operand is located in a data register, it is referenced relative to the ST(0)register (the register at the top of the register stack), rather than by a physicalregister number. Often the ST(0) register is an implied operand.Operands in memory can be referenced using the same operand addressing methodsdescribed in Section 3.7, “Operand Addressing.”8.3.3Data Transfer InstructionsThe data transfer instructions (see Table 8-4) perform the following operations:•Load a floating-point, integer, or packed BCD operand from memory into theST(0) register.•Store the value in an ST(0) register to memory in floating-point, integer, orpacked BCD format.•Move values between registers in the x87 FPU register stack.The FLD (load floating point) instruction pushes a floating-point operand frommemory onto the top of the x87 FPU data-register stack.

If the operand is in singleprecision or double-precision floating-point format, it is automatically converted todouble extended-precision floating-point format. This instruction can also be used topush the value in a selected x87 FPU data register onto the top of the register stack.8-22 Vol. 1PROGRAMMING WITH THE X87 FPUThe FILD (load integer) instruction converts an integer operand in memory intodouble extended-precision floating-point format and pushes the value onto the top ofthe register stack. The FBLD (load packed decimal) instruction performs the sameload operation for a packed BCD operand in memory.Table 8-4. Data Transfer InstructionsFloating PointIntegerPacked DecimalFLDLoad FloatingPointFILDLoad IntegerFSTStore FloatingPointFISTStore IntegerFSTPStore FloatingPoint and PopFISTPStore Integerand PopFXCHExchange RegisterContentsFCMOVccConditional MoveFBLDLoad PackedDecimalFBSTPStore PackedDecimal and PopThe FST (store floating point) and FIST (store integer) instructions store the value inregister ST(0) in memory in the destination format (floating point or integer, respectively).

Again, the format conversion is carried out automatically.The FSTP (store floating point and pop), FISTP (store integer and pop), and FBSTP(store packed decimal and pop) instructions store the value in the ST(0) registersinto memory in the destination format (floating point, integer, or packed BCD), thenperforms a pop operation on the register stack. A pop operation causes the ST(0)register to be marked empty and the stack pointer (TOP) in the x87 FPU control workto be incremented by 1. The FSTP instruction can also be used to copy the value inthe ST(0) register to another x87 FPU register [ST(i)].The FXCH (exchange register contents) instruction exchanges the value in a selectedregister in the stack [ST(i)] with the value in ST(0).The FCMOVcc (conditional move) instructions move the value in a selected register inthe stack [ST(i)] to register ST(0) if a condition specified with a condition code (cc) issatisfied (see Table 8-5).

The condition being tested for is represented by the statusflags in the EFLAGS register. The condition code mnemonics are appended to theletters “FCMOV” to form the mnemonic for a FCMOVcc instruction.Table 8-5. Floating-Point Conditional Move InstructionsInstruction MnemonicStatus Flag StatesCondition DescriptionFCMOVBCF=1BelowFCMOVNBCF=0Not belowFCMOVEZF=1EqualFCMOVNEZF=0Not equalVol. 1 8-23PROGRAMMING WITH THE X87 FPUTable 8-5. Floating-Point Conditional Move Instructions (Contd.)Instruction MnemonicStatus Flag StatesCondition DescriptionFCMOVBECF=1 or ZF=1Below or equalFCMOVNBECF=0 or ZF=0Not below nor equalFCMOVUPF=1UnorderedFCMOVNUPF=0Not unorderedLike the CMOVcc instructions, the FCMOVcc instructions are useful for optimizingsmall IF constructions.

They also help eliminate branching overhead for IF operationsand the possibility of branch mispredictions by the processor.Software can check if the FCMOVcc instructions are supported by checking theprocessor’s feature information with the CPUID instruction.8.3.4Load Constant InstructionsThe following instructions push commonly used constants onto the top [ST(0)] of thex87 FPU register stack:FLDZLoad +0.0FLD1Load +1.0FLDPILoad πFLDL2TLoad log2 10FLDL2ELoad log2eFLDLG2Load log102FLDLN2Load loge2The constant values have full double extended-precision floating-point precision(64 bits) and are accurate to approximately 19 decimal digits. They are storedinternally in a format more precise than double extended-precision floating point.When loading the constant, the x87 FPU rounds the more precise internal constantaccording to the RC (rounding control) field of the x87 FPU control word.

Theinexact-result exception (#P) is not generated as a result of this rounding, nor isthe C1 flag set in the x87 FPU status word if the value is rounded up. See Section8.3.8, “Pi,” for information on the π constant.8.3.5Basic Arithmetic InstructionsThe following floating-point instructions perform basic arithmetic operations onfloating-point numbers. Where applicable, these instructions match IEEE Standard754:FADD/FADDP8-24 Vol. 1Add floating pointPROGRAMMING WITH THE X87 FPUFIADDFSUB/FSUBPFISUBFSUBR/FSUBRPFISUBRFMUL/FMULPFIMULFDIV/FDIVPFIDIVFDIVR/FDIVRPFIDIVRFABSFCHSFSQRTFPREMFPREM1FRNDINTFXTRACTAdd integer to floating pointSubtract floating pointSubtract integer from floating pointReverse subtract floating pointReverse subtract floating point from integerMultiply floating pointMultiply integer by floating pointDivide floating pointDivide floating point by integerReverse divideReverse divide integer by floating pointAbsolute valueChange signSquare rootPartial remainderIEEE partial remainderRound to integral valueExtract exponent and significandThe add, subtract, multiply and divide instructions operate on the following types ofoperands:••Two x87 FPU data registersAn x87 FPU data register and a floating-point or integer value in memorySee Section 8.1.2, “x87 FPU Data Registers,” for a description of how operands arereferenced on the data register stack.Operands in memory can be in single-precision floating-point, double-precisionfloating-point, word-integer, or doubleword-integer format.

They are converted todouble extended-precision floating-point format automatically.Reverse versions of the subtract (FSUBR) and divide (FDIVR) instructions enable efficient coding. For example, the following options are available with the FSUB andFSUBR instructions for operating on values in a specified x87 FPU data register ST(i)and the ST(0) register:FSUB:ST(0) ← ST(0) − ST(i)ST(i) ← ST(i) − ST(0)FSUBR:ST(0) ← ST(i) − ST(0)ST(i) ← ST(0) − ST(i)These instructions eliminate the need to exchange values between the ST(0) registerand another x87 FPU register to perform a subtraction or division.Vol. 1 8-25PROGRAMMING WITH THE X87 FPUThe pop versions of the add, subtract, multiply, and divide instructions offer theoption of popping the x87 FPU register stack following the arithmetic operation.These instructions operate on values in the ST(i) and ST(0) registers, store the resultin the ST(i) register, and pop the ST(0) register.The FPREM instruction computes the remainder from the division of two operands inthe manner used by the Intel 8087 and Intel 287 math coprocessors; the FPREM1instruction computes the remainder in the manner specified in IEEE Standard 754.The FSQRT instruction computes the square root of the source operand.The FRNDINT instruction returns a floating-point value that is the integral valueclosest to the source value in the direction of the rounding mode specified in the RCfield of the x87 FPU control word.The FABS, FCHS, and FXTRACT instructions perform convenient arithmetic operations.

Характеристики

Тип файла
PDF-файл
Размер
3,16 Mb
Материал
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
Как Вы думаете, сколько людей до Вас делали точно такое же задание? 99% студентов выполняют точно такие же задания, как и их предшественники год назад. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6418
Авторов
на СтудИзбе
307
Средний доход
с одного платного файла
Обучение Подробнее