Commit Graph

21 Commits

Author SHA1 Message Date
Eric Anholt
aeab105342 Remove fake ir_binop_logic_not. I think you meant ir_unop_logic_not. 2010-04-02 11:22:41 -07:00
Ian Romanick
3c6fea3048 Implement ir_if (for if-statments) and conversion from AST
The following tests now pass:

    glslparsertest/shaders/if1.frag
    glslparsertest/shaders/if2.frag

The following tests that used to pass now fail.  It appears that most
of these fail because ast_nequal and ast_equal are not converted to HIR.

    shaders/glsl-unused-varying.frag
    shaders/glsl-fs-sqrt-branch.frag
2010-03-29 15:17:11 -07:00
Eric Anholt
01665262e5 Implement exp2() and log2(), and make ir_unop_exp and ir_unop_log be base e.
Making the base e functions IR operations is not a clear win.  i965
doesn't support it, it doesn't look like r600 supports it, but r500
does. It should be easily supportable as a lowering pass, though.
2010-03-29 12:48:45 -07:00
Eric Anholt
44d68fd06f Add sqrt() builtin as an IR operation.
Following a discussion in #dri-devel, I think this makes more sense
than implementing it as RSQ RCP CMP as Mesa did.  The i965 has a
hardware sqrt that should work, and AMD is suppposed to be able to
implement it as RSQ RCP with an alternate floating point mode so that
the 0.0 case is handled like we want.
2010-03-29 12:48:45 -07:00
Eric Anholt
ddd2e83db2 Add builtin pow() function. 2010-03-29 12:48:45 -07:00
Eric Anholt
e65e12fdbc IR print visitor: Print out something for the operator. 2010-03-26 17:51:40 -07:00
Ian Romanick
d1dfe8b994 IR print visitor: Print expressions a little better 2010-03-26 17:42:10 -07:00
Ian Romanick
5508129fd8 IR print visitor: print function calls 2010-03-26 17:30:30 -07:00
Ian Romanick
d811d47609 Add glsl_type::components to query total number of components in a type 2010-03-26 14:43:11 -07:00
Kenneth Graunke
affc1413ac Move swizzles out of ir_dereference and into their own class.
Also turn generate_swizzle into a static "create" method of the new
class; we'll want to use it for the IR reader as well.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-03-26 14:00:59 -07:00
Kenneth Graunke
fb9fb5f51d Add new abstract ir_rvalue class; rework accordingly.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-03-26 13:58:48 -07:00
Ian Romanick
7954922473 IR print visitor: Finish printing constants 2010-03-25 18:40:48 -07:00
Ian Romanick
d14642739e IR print visitor: Remove most of the newlines from the printed output
This makes it a lot easier to read... if you have a really wide display.
2010-03-25 18:40:48 -07:00
Ian Romanick
d7388f389d IR print visitor: print expressions
Not quite complete.  The operator is not yet printed.
2010-03-25 18:40:48 -07:00
Ian Romanick
8c70a62193 IR print visitor: print ir_dereference instructions
Also make a slight change to ir_variable.  The ir_dereference tracks
the number of nested dereferences.  If an ir_variable is visited and
the count is non-zero, just print the name of the variable.
2010-03-25 18:40:36 -07:00
Ian Romanick
6e7c278e24 IR print visitor: Less newlines when printing ir_variables 2010-03-25 18:39:59 -07:00
Ian Romanick
9578c87ce2 Implement IR return instructions 2010-03-19 16:44:52 -07:00
Ian Romanick
ed45ec6a51 Add ir_call call to represent function calls. 2010-03-11 14:35:37 -08:00
Ian Romanick
fe10250355 IR print visitor: Add some support for printing types and constants 2010-03-09 21:44:34 -08:00
Ian Romanick
6044ae79a0 IR print visitor: Print assignments 2010-03-09 16:40:45 -08:00
Ian Romanick
78b51b0fdd IR visitor: Add initial version of ir_visitor classes
The ir_visitor class is the abstract base class for all visitors.
ir_print_visitor contains the beginnings of a concrete visitor class
that will print out an IR sequence in a Lisp / Scheme-like syntax.
2010-03-09 16:26:15 -08:00