md.texi (cmpstr): Document additional restrictions.

gcc:
	* doc/md.texi (cmpstr): Document additional restrictions.

testsuite:
	* gcc.c-torture/execute/string-opt-8.c: Don't perform cmpstr
	checks for __pj__, but do them for !__OPTIMIZE__ and __s390__.

From-SVN: r66116
This commit is contained in:
Kaveh R. Ghazi 2003-04-26 20:44:30 +00:00 committed by Kaveh Ghazi
parent e2b694230a
commit 5cc2f4f36f
4 changed files with 18 additions and 5 deletions

View File

@ -1,3 +1,7 @@
2003-04-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* doc/md.texi (cmpstr): Document additional restrictions.
2003-04-26 Neil Booth <neil@daikokuya.co.uk>
* flags.h (time_report): Remove.

View File

@ -2788,9 +2788,12 @@ The use for multiple @code{clrstr@var{m}} is as for @code{movstr@var{m}}.
Block compare instruction, with five operands. Operand 0 is the output;
it has mode @var{m}. The remaining four operands are like the operands
of @samp{movstr@var{m}}. The two memory blocks specified are compared
byte by byte in lexicographic order. The effect of the instruction is
to store a value in operand 0 whose sign indicates the result of the
comparison.
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.
@cindex @code{strlen@var{m}} instruction pattern
@item @samp{strlen@var{m}}

View File

@ -1,3 +1,8 @@
2003-04-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.c-torture/execute/string-opt-8.c: Don't perform cmpstr
checks for __pj__, but do them for !__OPTIMIZE__ and __s390__.
2003-04-25 Mark Mitchell <mark@codesourcery.com>
* g++.old-deja/g++.pt/instantiate12.C: Explicit instantiate

View File

@ -65,8 +65,9 @@ int main ()
s2 = s1; s3 = s1+4;
if (strncmp (++s2, ++s3+2, 1) >= 0 || s2 != s1+1 || s3 != s1+5)
abort();
#if defined(__i386__) || defined (__pj__) || defined (__i370__)
/* These tests work on platforms which support cmpstrsi. */
#if !defined(__OPTIMIZE__) || defined(__i386__) || defined (__i370__) || defined (__s390__)
/* These tests work on platforms which support cmpstrsi. We test it
at -O0 on all platforms to ensure the strncmp logic is correct. */
s2 = s1;
if (strncmp (++s2, "ello", 3) != 0 || s2 != s1+1)
abort();