History log of /external/mesa3d/src/glsl/s_expression.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4f82fed49359676fc19598f8c65ca51958dd2d79 17-Jan-2012 Paul Berry <stereotype441@gmail.com> glsl: Fix isinf() for non-C99-compliant compilers.

Commit ede60bc4670a8d9c14921c77abee1ac57fc0e6bf (glsl: Add isinf() and
isnan() builtins) uses "+INF" in the .ir file to represent infinity.
This worked on C99-compliant compilers, since the s-expression reader
uses strtod() to read numbers, and C99 requires strtod() to understand
"+INF". However, it didn't work on non-C99-compliant compilers such
as MSVC.

This patch modifies the s-expression reader to explicitly check for
"+INF" rather than relying on strtod() to support it.

This is a candidate for the 8.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44767
Tested-by: Morgan Armand <morgan.devel@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/s_expression.cpp
3875526926123259521514de9c8d675e3797275a 15-Jul-2011 Kenneth Graunke <kenneth@whitecape.org> glsl: Avoid massive ralloc_strndup overhead in S-Expression parsing.

When parsing S-Expressions, we need to store nul-terminated strings for
Symbol nodes. Prior to this patch, we called ralloc_strndup each time
we constructed a new s_symbol. It turns out that this is obscenely
expensive.

Instead, copy the whole buffer before parsing and overwrite it to
contain \0 bytes at the appropriate locations. Since atoms are
separated by whitespace, (), or ;, we can safely overwrite the character
after a Symbol. While much of the buffer may be unused, copying the
whole buffer is simple and guaranteed to provide enough space.

Prior to this, running piglit-run.py -t glsl tests/quick.tests with GLSL
1.30 enabled took just over 10 minutes on my machine. Now it takes 5.

NOTE: This is a candidate for stable release branches (because it will
make running comparison tests so much less irritating.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/glsl/s_expression.cpp
497baf4e4a6a0a2f247c7bfb9bf69a2b93c2c19f 10-Feb-2011 Ian Romanick <ian.d.romanick@intel.com> Use C-style system headers in C++ code to avoid issues with std:: namespace
/external/mesa3d/src/glsl/s_expression.cpp
d3073f58c17d8675a2ecdd5dfa83e5520c78e1a8 21-Jan-2011 Kenneth Graunke <kenneth@whitecape.org> Convert everything from the talloc API to the ralloc API.
/external/mesa3d/src/glsl/s_expression.cpp
47b2af2c62fec3ac0fb501a31e93fc8d00c18cb8 01-Jan-2011 Kenneth Graunke <kenneth@whitecape.org> glsl/s_expression: Read and ignore Scheme-style comments.

A single-semicolon until the end of the line, i.e.
; this is a comment.
/external/mesa3d/src/glsl/s_expression.cpp
d7988152722cd5f3930064a139b567cbcb0e5f53 31-Dec-2010 Kenneth Graunke <kenneth@whitecape.org> ir_reader: Remove s_list::length() method.

Most code now relies on the pattern matcher rather than this function,
and for the only remaining case, not using this saves an iteration.
/external/mesa3d/src/glsl/s_expression.cpp
daeb0c646e0d652bfa16d326028753ecf092c0c9 03-Nov-2010 Kenneth Graunke <kenneth@whitecape.org> ir_reader: Add a pattern matching system and use it everywhere.

Previously, the IR reader was riddled with code that:
1. Checked for the right number of list elements (via a linked list walk)
2. Retrieved references to each component (via ->next->next pointers)
3. Downcasted as necessary to make sure that each sub-component was the
right type (i.e. symbol, int, list).
4. Checking that the tag (i.e. "declare") was correct.

This was all very ad-hoc and a bit ugly. Error checking had to be done
at both steps 1, 3, and 4. Most code didn't even check the tag, relying
on the caller to do so. Not all callers did.

The new pattern matching module performs the whole process in a single
straightforward function call, resulting in shorter, more readable code.

Unfortunately, MSVC does not support C99-style anonymous arrays, so the
pattern must be declared outside of the match call.
/external/mesa3d/src/glsl/s_expression.cpp
bb10e081c8ddc452bca44ba583f239219a5b9372 13-Dec-2010 Brian Paul <brianp@vmware.com> glsl: new glsl_strtod() wrapper to fix decimal point interpretation

We always want to use '.' as the decimal point.

See http://bugs.freedesktop.org/show_bug.cgi?id=24531

NOTE: this is a candidate for the 7.10 branch.
/external/mesa3d/src/glsl/s_expression.cpp
d2c23ac82a4038c0f69b6ce5b0c49f763a65df8a 31-Oct-2010 Kenneth Graunke <kenneth@whitecape.org> glsl: Don't print a useless space at the end of an S-Expression list.

We really only want to print spaces -between- elements, not after each
element. This cleans up error messages from IR reader, making them
(mildly) easier to read.
/external/mesa3d/src/glsl/s_expression.cpp
365ce61997a28a0c0dad79e7d3f7616e57f105f5 19-Aug-2010 Kenneth Graunke <kenneth@whitecape.org> glsl: Replace sscanf in s_expression reader with strspn and strcspn.

This seems to give roughly a 20% speedup.
/external/mesa3d/src/glsl/s_expression.cpp
29285882676388aacff123e8bdf025904abf8ea9 25-Jun-2010 Eric Anholt <eric@anholt.net> glsl2: Move the compiler to the subdirectory it will live in in Mesa.
/external/mesa3d/src/glsl/s_expression.cpp