diff options
Diffstat (limited to 'gcc-4.6/gcc/doc/md.texi')
-rw-r--r-- | gcc-4.6/gcc/doc/md.texi | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/gcc-4.6/gcc/doc/md.texi b/gcc-4.6/gcc/doc/md.texi index 0890423..b659015 100644 --- a/gcc-4.6/gcc/doc/md.texi +++ b/gcc-4.6/gcc/doc/md.texi @@ -4641,8 +4641,9 @@ byte by byte in lexicographic order starting at the beginning of each string. The instruction is not allowed to prefetch more than one byte at a time since either string may end in the first byte and reading past that may access an invalid page or segment and cause a fault. The -effect of the instruction is to store a value in operand 0 whose sign -indicates the result of the comparison. +comparison terminates early if the fetched bytes are different or if +they are equal to zero. The effect of the instruction is to store a +value in operand 0 whose sign indicates the result of the comparison. @cindex @code{cmpstr@var{m}} instruction pattern @item @samp{cmpstr@var{m}} @@ -4660,8 +4661,10 @@ The two memory blocks specified are compared byte by byte in lexicographic order starting at the beginning of each string. The instruction is not allowed to prefetch more than one byte at a time since either string may end in the first byte and reading past that may access an invalid page or segment and -cause a fault. The effect of the instruction is to store a value in operand 0 -whose sign indicates the result of the comparison. +cause a fault. The comparison will terminate when the fetched bytes +are different or if they are equal to zero. The effect of the +instruction is to store a value in operand 0 whose sign indicates the +result of the comparison. @cindex @code{cmpmem@var{m}} instruction pattern @item @samp{cmpmem@var{m}} @@ -4669,9 +4672,10 @@ Block compare instruction, with five operands like the operands of @samp{cmpstr@var{m}}. The two memory blocks specified are compared byte by byte in lexicographic order starting at the beginning of each block. Unlike @samp{cmpstr@var{m}} the instruction can prefetch -any bytes in the two memory blocks. The effect of the instruction is -to store a value in operand 0 whose sign indicates the result of the -comparison. +any bytes in the two memory blocks. Also unlike @samp{cmpstr@var{m}} +the comparison will not stop if both bytes are zero. The effect of +the instruction is to store a value in operand 0 whose sign indicates +the result of the comparison. @cindex @code{strlen@var{m}} instruction pattern @item @samp{strlen@var{m}} @@ -5510,7 +5514,7 @@ will be emitted, followed by a store of the value to the memory operand. @cindex @code{stack_protect_set} instruction pattern @item @samp{stack_protect_set} -This pattern, if defined, moves a @code{Pmode} value from the memory +This pattern, if defined, moves a @code{ptr_mode} value from the memory in operand 1 to the memory in operand 0 without leaving the value in a register afterward. This is to avoid leaking the value some place that an attacker might use to rewrite the stack guard slot after @@ -5521,7 +5525,7 @@ If this pattern is not defined, then a plain move pattern is generated. @cindex @code{stack_protect_test} instruction pattern @item @samp{stack_protect_test} -This pattern, if defined, compares a @code{Pmode} value from the +This pattern, if defined, compares a @code{ptr_mode} value from the memory in operand 1 with the memory in operand 0 without leaving the value in a register afterward and branches to operand 2 if the values weren't equal. |