Jump to content

Edit filter log

Details for log entry 24462218

15:17, 23 July 2019: 138.131.178.64 (talk) triggered filter 172, performing the action "edit" on Saturation arithmetic. Actions taken: Tag; Filter description: Section blanking (examine)

Changes made in edit



Although saturation arithmetic is less popular for integer arithmetic in hardware, the [[IEEE floating-point standard]], the most popular abstraction for dealing with approximate real numbers, uses a form of saturation in which overflow is converted into "infinity" or "negative infinity", and any other operation on this result continues to produce the same value. This has the advantage over simple saturation that later operations which decrease the value will not end up producing a misleadingly "reasonable" result, such as in the computation <math>\sqrt{x^2 - y^2}</math>. Alternatively, there may be special states such as "exponent overflow" (and "exponent underflow") that will similarly persist through subsequent operations, or cause immediate termination, or be tested for as in <code>IF ACCUMULATOR OVERFLOW ...</code> as in FORTRAN for the IBM704 (October 1956).
Although saturation arithmetic is less popular for integer arithmetic in hardware, the [[IEEE floating-point standard]], the most popular abstraction for dealing with approximate real numbers, uses a form of saturation in which overflow is converted into "infinity" or "negative infinity", and any other operation on this result continues to produce the same value. This has the advantage over simple saturation that later operations which decrease the value will not end up producing a misleadingly "reasonable" result, such as in the computation <math>\sqrt{x^2 - y^2}</math>. Alternatively, there may be special states such as "exponent overflow" (and "exponent underflow") that will similarly persist through subsequent operations, or cause immediate termination, or be tested for as in <code>IF ACCUMULATOR OVERFLOW ...</code> as in FORTRAN for the IBM704 (October 1956).

==DSP and GPU support==
The [[VideoCore]] GPU system used on many mobile telephones implements saturation arithmetic. The support is mainly for video decoding, so as to avoid visual defects.


==Notes==
==Notes==

Action parameters

VariableValue
Edit count of the user (user_editcount)
null
Name of the user account (user_name)
'138.131.178.64'
Age of the user account (user_age)
0
Groups (including implicit) the user is in (user_groups)
[ 0 => '*' ]
Rights that the user has (user_rights)
[ 0 => 'createaccount', 1 => 'read', 2 => 'edit', 3 => 'createtalk', 4 => 'writeapi', 5 => 'viewmywatchlist', 6 => 'editmywatchlist', 7 => 'viewmyprivateinfo', 8 => 'editmyprivateinfo', 9 => 'editmyoptions', 10 => 'abusefilter-log-detail', 11 => 'centralauth-merge', 12 => 'abusefilter-view', 13 => 'abusefilter-log', 14 => 'vipsscaler-test' ]
Whether the user is editing from mobile app (user_app)
false
Whether or not a user is editing through the mobile interface (user_mobile)
false
Page ID (page_id)
1830167
Page namespace (page_namespace)
0
Page title without namespace (page_title)
'Saturation arithmetic'
Full page title (page_prefixedtitle)
'Saturation arithmetic'
Last ten users to contribute to the page (page_recent_contributors)
[ 0 => 'A876', 1 => 'Mikhail Ryazanov', 2 => 'Cupid1889', 3 => '2600:1700:7261:3361:6C38:BA9B:FA7:3739', 4 => 'Santiago Bautista', 5 => 'Liqiu', 6 => 'NickyMcLean', 7 => '114.25.127.101', 8 => 'Cafeduke', 9 => 'Foia req' ]
Action (action)
'edit'
Edit summary/reason (summary)
'/* DSP and GPU support */ removed section: this is just one specific implementation and not even that common, in this form it has no place in a generic article. '
Old content model (old_content_model)
'wikitext'
New content model (new_content_model)
'wikitext'
Old page wikitext, before the edit (old_wikitext)
''''Saturation arithmetic''' is a version of [[arithmetic]] in which all operations such as addition and multiplication are limited to a fixed range between a minimum and maximum value. If the result of an operation is greater than the maximum, it is set ("clamped") to the maximum; if it is below the minimum, it is clamped to the minimum. The name comes from how the value becomes "saturated" once it reaches the extreme values; further additions to a maximum or subtractions from a minimum will not change the result. For example, if the valid range of values is from −100 to 100, the following ''saturating arithmetic operations'' produce the following values: *60 + 30 → 90. *60 + 43 → 100. (''not'' the expected 103.) *(60 + 43) − (75 + 75) → 0. (''not'' the expected −47.) (100 − 100 → 0.) *10 × 11 → 100. (''not'' the expected 110.) *99 × 99 → 100. (''not'' the expected 9801.) *30 × (5 − 1) → 100. (''not'' the expected 120.) (30 × 4 → 100.) *(30 × 5) − (30 × 1) → 70. (''not'' the expected 120. ''not'' the previous 100.) (100 − 30 → 70.) As can be seen from these examples, familiar properties like [[associativity]] and [[distributivity]] may fail in saturation arithmetic.<ref>In fact, ''non''-saturation arithmetic can also suffer associativity and distributivity failures in limited-precision environments, but such failures tend to be less obvious.</ref> This makes it unpleasant to deal with in abstract mathematics, but it has an important role to play in [[digital hardware]] and algorithms. ==Modern use== Typically, general-purpose [[microprocessor]]s do not implement integer arithmetic operations using saturation arithmetic; instead, they use the easier-to-implement [[modular arithmetic]], in which values exceeding the maximum value "[[integer overflow|wrap around]]" to the minimum value, like the hours on a clock passing from 12 to 1. In hardware, modular arithmetic with a minimum of zero and a maximum of ''r''<sup>''n''</sup> − 1, where ''r'' is the [[radix]] can be implemented by simply discarding all but the lowest ''n'' digits. For binary hardware, which the vast majority of modern hardware is, the radix is 2, and the digits are bits. However, although more difficult to implement, saturation arithmetic has numerous practical advantages. The result is as numerically close to the true answer as possible; for 8-bit binary signed arithmetic, when the correct answer is 130, it is considerably less surprising to get an answer of 127 from saturating arithmetic than to get an answer of −126 from modular arithmetic. Likewise, for 8-bit binary unsigned arithmetic, when the correct answer is 258, it is less surprising to get an answer of 255 from saturating arithmetic than to get an answer of 2 from modular arithmetic. Saturation arithmetic also enables overflow of additions and multiplications to be detected consistently without an overflow bit or excessive computation, by simple comparison with the maximum or minimum value (provided the datum is not permitted to take on these values). Additionally, saturation arithmetic enables efficient algorithms for many problems, particularly in [[digital signal processing]]. For example, adjusting the volume level of a sound signal can result in overflow, and saturation causes significantly less distortion to the sound than wrap-around. In the words of researchers G. A. Constantinides et al.:<ref>G. A. Constantinides, P. Y. K. Cheung, and W. Luk. ''[http://portal.acm.org/citation.cfm?id=785411.785415 Synthesis of Saturation Arithmetic Architectures]''.</ref> {{quote|When adding two numbers using two's complement representation, overflow results in a "wrap-around" phenomenon. The result can be a catastrophic loss in signal-to-noise ratio in a DSP system. Signals in DSP designs are therefore usually either scaled appropriately to avoid overflow for all but the most extreme input vectors, or produced using saturation arithmetic components.}} Saturation arithmetic operations are available on many modern platforms, and in particular was one of the extensions made by the Intel [[MMX (instruction set)|MMX]] platform, specifically for such signal-processing applications. This functionality is also available in wider versions in the [[SSE2]] and [[AVX2]] integer instruction sets. Saturation arithmetic for integers has also been implemented in software for a number of programming languages including [[C (programming language)|C]], [[C++]], such as the [[GNU Compiler Collection]],<ref>{{cite web |title=GNU Compiler Collection (GCC) Internals: Arithmetic |url=https://gcc.gnu.org/onlinedocs/gccint/Arithmetic.html |website=gcc.gnu.org}}</ref> and [[Eiffel (programming language)|Eiffel]]. This helps programmers anticipate and understand the effects of overflow better. On the other hand, saturation is challenging to implement efficiently in software on a machine with only modular arithmetic operations, since simple implementations require branches that create huge pipeline delays. However, it is possible to implement saturating addition and subtraction in software without branches, using only modular arithmetic and bitwise logical operations that are available on all modern CPUs and their predecessors, including all x86 CPUs (back to the original [[Intel 8086]]) and some popular 8-bit CPUs (some of which, such as the [[Zilog Z80]], are still in production). On the other hand, on simple 8-bit and 16-bit CPUs, a branching algorithm might actually be faster if programmed in assembly, since there are no pipelines to stall, and each instruction always takes multiple clock cycles. Although saturation arithmetic is less popular for integer arithmetic in hardware, the [[IEEE floating-point standard]], the most popular abstraction for dealing with approximate real numbers, uses a form of saturation in which overflow is converted into "infinity" or "negative infinity", and any other operation on this result continues to produce the same value. This has the advantage over simple saturation that later operations which decrease the value will not end up producing a misleadingly "reasonable" result, such as in the computation <math>\sqrt{x^2 - y^2}</math>. Alternatively, there may be special states such as "exponent overflow" (and "exponent underflow") that will similarly persist through subsequent operations, or cause immediate termination, or be tested for as in <code>IF ACCUMULATOR OVERFLOW ...</code> as in FORTRAN for the IBM704 (October 1956). ==DSP and GPU support== The [[VideoCore]] GPU system used on many mobile telephones implements saturation arithmetic. The support is mainly for video decoding, so as to avoid visual defects. ==Notes== {{Reflist}} ==External links== *[http://compilers.iecc.com/comparch/article/00-02-022 SARITH: Safe ARITHmetic – A Progress Report]: Report on a saturation arithmetic component for [[Eiffel (programming language)|Eiffel]]. [[Category:Computer arithmetic]]'
New page wikitext, after the edit (new_wikitext)
''''Saturation arithmetic''' is a version of [[arithmetic]] in which all operations such as addition and multiplication are limited to a fixed range between a minimum and maximum value. If the result of an operation is greater than the maximum, it is set ("clamped") to the maximum; if it is below the minimum, it is clamped to the minimum. The name comes from how the value becomes "saturated" once it reaches the extreme values; further additions to a maximum or subtractions from a minimum will not change the result. For example, if the valid range of values is from −100 to 100, the following ''saturating arithmetic operations'' produce the following values: *60 + 30 → 90. *60 + 43 → 100. (''not'' the expected 103.) *(60 + 43) − (75 + 75) → 0. (''not'' the expected −47.) (100 − 100 → 0.) *10 × 11 → 100. (''not'' the expected 110.) *99 × 99 → 100. (''not'' the expected 9801.) *30 × (5 − 1) → 100. (''not'' the expected 120.) (30 × 4 → 100.) *(30 × 5) − (30 × 1) → 70. (''not'' the expected 120. ''not'' the previous 100.) (100 − 30 → 70.) As can be seen from these examples, familiar properties like [[associativity]] and [[distributivity]] may fail in saturation arithmetic.<ref>In fact, ''non''-saturation arithmetic can also suffer associativity and distributivity failures in limited-precision environments, but such failures tend to be less obvious.</ref> This makes it unpleasant to deal with in abstract mathematics, but it has an important role to play in [[digital hardware]] and algorithms. ==Modern use== Typically, general-purpose [[microprocessor]]s do not implement integer arithmetic operations using saturation arithmetic; instead, they use the easier-to-implement [[modular arithmetic]], in which values exceeding the maximum value "[[integer overflow|wrap around]]" to the minimum value, like the hours on a clock passing from 12 to 1. In hardware, modular arithmetic with a minimum of zero and a maximum of ''r''<sup>''n''</sup> − 1, where ''r'' is the [[radix]] can be implemented by simply discarding all but the lowest ''n'' digits. For binary hardware, which the vast majority of modern hardware is, the radix is 2, and the digits are bits. However, although more difficult to implement, saturation arithmetic has numerous practical advantages. The result is as numerically close to the true answer as possible; for 8-bit binary signed arithmetic, when the correct answer is 130, it is considerably less surprising to get an answer of 127 from saturating arithmetic than to get an answer of −126 from modular arithmetic. Likewise, for 8-bit binary unsigned arithmetic, when the correct answer is 258, it is less surprising to get an answer of 255 from saturating arithmetic than to get an answer of 2 from modular arithmetic. Saturation arithmetic also enables overflow of additions and multiplications to be detected consistently without an overflow bit or excessive computation, by simple comparison with the maximum or minimum value (provided the datum is not permitted to take on these values). Additionally, saturation arithmetic enables efficient algorithms for many problems, particularly in [[digital signal processing]]. For example, adjusting the volume level of a sound signal can result in overflow, and saturation causes significantly less distortion to the sound than wrap-around. In the words of researchers G. A. Constantinides et al.:<ref>G. A. Constantinides, P. Y. K. Cheung, and W. Luk. ''[http://portal.acm.org/citation.cfm?id=785411.785415 Synthesis of Saturation Arithmetic Architectures]''.</ref> {{quote|When adding two numbers using two's complement representation, overflow results in a "wrap-around" phenomenon. The result can be a catastrophic loss in signal-to-noise ratio in a DSP system. Signals in DSP designs are therefore usually either scaled appropriately to avoid overflow for all but the most extreme input vectors, or produced using saturation arithmetic components.}} Saturation arithmetic operations are available on many modern platforms, and in particular was one of the extensions made by the Intel [[MMX (instruction set)|MMX]] platform, specifically for such signal-processing applications. This functionality is also available in wider versions in the [[SSE2]] and [[AVX2]] integer instruction sets. Saturation arithmetic for integers has also been implemented in software for a number of programming languages including [[C (programming language)|C]], [[C++]], such as the [[GNU Compiler Collection]],<ref>{{cite web |title=GNU Compiler Collection (GCC) Internals: Arithmetic |url=https://gcc.gnu.org/onlinedocs/gccint/Arithmetic.html |website=gcc.gnu.org}}</ref> and [[Eiffel (programming language)|Eiffel]]. This helps programmers anticipate and understand the effects of overflow better. On the other hand, saturation is challenging to implement efficiently in software on a machine with only modular arithmetic operations, since simple implementations require branches that create huge pipeline delays. However, it is possible to implement saturating addition and subtraction in software without branches, using only modular arithmetic and bitwise logical operations that are available on all modern CPUs and their predecessors, including all x86 CPUs (back to the original [[Intel 8086]]) and some popular 8-bit CPUs (some of which, such as the [[Zilog Z80]], are still in production). On the other hand, on simple 8-bit and 16-bit CPUs, a branching algorithm might actually be faster if programmed in assembly, since there are no pipelines to stall, and each instruction always takes multiple clock cycles. Although saturation arithmetic is less popular for integer arithmetic in hardware, the [[IEEE floating-point standard]], the most popular abstraction for dealing with approximate real numbers, uses a form of saturation in which overflow is converted into "infinity" or "negative infinity", and any other operation on this result continues to produce the same value. This has the advantage over simple saturation that later operations which decrease the value will not end up producing a misleadingly "reasonable" result, such as in the computation <math>\sqrt{x^2 - y^2}</math>. Alternatively, there may be special states such as "exponent overflow" (and "exponent underflow") that will similarly persist through subsequent operations, or cause immediate termination, or be tested for as in <code>IF ACCUMULATOR OVERFLOW ...</code> as in FORTRAN for the IBM704 (October 1956). ==Notes== {{Reflist}} ==External links== *[http://compilers.iecc.com/comparch/article/00-02-022 SARITH: Safe ARITHmetic – A Progress Report]: Report on a saturation arithmetic component for [[Eiffel (programming language)|Eiffel]]. [[Category:Computer arithmetic]]'
Unified diff of changes made by edit (edit_diff)
'@@ -29,7 +29,4 @@ Although saturation arithmetic is less popular for integer arithmetic in hardware, the [[IEEE floating-point standard]], the most popular abstraction for dealing with approximate real numbers, uses a form of saturation in which overflow is converted into "infinity" or "negative infinity", and any other operation on this result continues to produce the same value. This has the advantage over simple saturation that later operations which decrease the value will not end up producing a misleadingly "reasonable" result, such as in the computation <math>\sqrt{x^2 - y^2}</math>. Alternatively, there may be special states such as "exponent overflow" (and "exponent underflow") that will similarly persist through subsequent operations, or cause immediate termination, or be tested for as in <code>IF ACCUMULATOR OVERFLOW ...</code> as in FORTRAN for the IBM704 (October 1956). - -==DSP and GPU support== -The [[VideoCore]] GPU system used on many mobile telephones implements saturation arithmetic. The support is mainly for video decoding, so as to avoid visual defects. ==Notes== '
New page size (new_size)
6794
Old page size (old_size)
6986
Size change in edit (edit_delta)
-192
Lines added in edit (added_lines)
[]
Lines removed in edit (removed_lines)
[ 0 => false, 1 => '==DSP and GPU support==', 2 => 'The [[VideoCore]] GPU system used on many mobile telephones implements saturation arithmetic. The support is mainly for video decoding, so as to avoid visual defects.' ]
Whether or not the change was made through a Tor exit node (tor_exit_node)
false
Unix timestamp of change (timestamp)
1563895057