Редактирование: Преобразования
Внимание! Вы не авторизовались на сайте. Ваш IP-адрес будет публично видимым, если вы будете вносить любые правки. Если вы войдёте или создадите учётную запись, правки вместо этого будут связаны с вашим именем пользователя, а также у вас появятся другие преимущества.
Правка может быть отменена. Пожалуйста, просмотрите сравнение версий, чтобы убедиться, что это именно те изменения, которые вас интересуют, и нажмите «Записать страницу», чтобы изменения вступили в силу.
Текущая версия | Ваш текст | ||
Строка 12: | Строка 12: | ||
sltof -- F(ll) | sltof -- F(ll) | ||
− | + | ||
<pre>Extending the precision of a temporary is done using the ext family of instructions. Because QBE types do not precise the signedness (like in LLVM), extension instructions exist to sign-extend and zero-extend a value. For example, extsb takes a word argument and sign-extend the 8 least-significant bits to a full word or long, depending on the return type.</pre> | <pre>Extending the precision of a temporary is done using the ext family of instructions. Because QBE types do not precise the signedness (like in LLVM), extension instructions exist to sign-extend and zero-extend a value. For example, extsb takes a word argument and sign-extend the 8 least-significant bits to a full word or long, depending on the return type.</pre> | ||
− | |||
<pre>The instructions exts and truncd are provided to change the precision of a floating point value. When the double argument of truncd cannot be represented as a single-precision floating point, it is truncated towards zero.</pre> | <pre>The instructions exts and truncd are provided to change the precision of a floating point value. When the double argument of truncd cannot be represented as a single-precision floating point, it is truncated towards zero.</pre> | ||
− | |||
<pre>Converting between signed integers and floating points is done using stosi (single to signed integer), dtosi (double to signed integer), swtof (signed word to float), and sltof (signed long to float). These instructions only handle signed integers, conversion to and from unsigned types are not yet supported.</pre> | <pre>Converting between signed integers and floating points is done using stosi (single to signed integer), dtosi (double to signed integer), swtof (signed word to float), and sltof (signed long to float). These instructions only handle signed integers, conversion to and from unsigned types are not yet supported.</pre> | ||
− | |||
<pre>Because of Subtyping, there is no need to have an instruction to lower the precision of an integer temporary.</pre> | <pre>Because of Subtyping, there is no need to have an instruction to lower the precision of an integer temporary.</pre> | ||