Kenneth Graunke
67e07ad3a3
Refresh autogenerated builtin_function.cpp.
2010-05-14 16:34:46 -07:00
Kenneth Graunke
b3262128fe
Replace old builtin_function.cpp with new autogenerated one.
2010-05-14 16:34:46 -07:00
Eric Anholt
25ebc0459f
builtin_functions: Clean up compiler warning about unused name, instructions.
2010-04-23 16:12:44 -07:00
Eric Anholt
ec9e73870c
Put static pointers to vec[234]_types along with the static float_type.
...
Otherwise you have to type a lot of get_instance.
2010-04-23 16:12:44 -07:00
Kenneth Graunke
67029b13b7
Actually emit temp declaration in vector comparison builtins.
2010-04-21 23:58:13 -07:00
Kenneth Graunke
9fa99f3b6c
Refactor IR function representation.
...
Now, ir_function is emitted as part of the IR instructions, rather than
simply existing in the symbol table. Individual ir_function_signatures
are not emitted themselves, but only as part of ir_function.
2010-04-21 15:36:36 -07:00
Eric Anholt
a3fa3fbf76
Add an implementation of gentype-only clamp().
2010-04-08 16:08:15 -07:00
Eric Anholt
cc4ef154e6
Add builtin implementations of vector comparison functions.
...
Fixes CorrectFunction1.vert, glsl-fs-notequal.frag.
2010-04-08 15:35:34 -07:00
Eric Anholt
cc49cea9ea
Add support for builtin gentype mix(gentype a, gentype b)
...
Fixes glsl-fs-mix.frag, glsl-fs-mix-constant.frag.
2010-04-08 15:10:37 -07:00
Eric Anholt
feeb43b829
Add buitlin functions for any(), all(), not().
2010-04-08 15:02:59 -07:00
Eric Anholt
925759283a
Add builtin normalize() functions.
...
Fixes CorrectSqizzle2.vert.
2010-04-08 14:38:32 -07:00
Eric Anholt
fbc7c0b8f2
Make function bodies rely on the parameter variable declarations.
...
Previously, generating inlined function bodies was going to be
difficult, as there was no mapping between the body's declaration of
variables where parameter values were supposed to live and the
parameter variables that a caller would use in paramater setup.
Presumably this also have been a problem for actual codegen.
2010-04-07 17:23:23 -07:00
Eric Anholt
6173312d84
Make dot() take the right number of args.
2010-04-07 17:23:23 -07:00
Eric Anholt
7e78e07ddb
Fix the returns of builtin functions to actually return.
2010-04-07 17:23:23 -07:00
Eric Anholt
894ea972a4
Put function bodies under function signatures, instead of flat in the parent.
...
This will let us know the length of function bodies for the purpose of
inlining (among other uses).
2010-04-07 17:23:23 -07:00
Ian Romanick
6a15d5b514
Use ir_function::add_signature to create link between function and signature
...
ir_function_signature now has a pointer back to the ir_function that owns it.
2010-03-31 16:37:10 -07:00
Eric Anholt
d1e31952ed
Add support for builtin radians() and degrees().
2010-03-29 12:48:45 -07:00
Eric Anholt
3cb4358f38
Add the instruction for the parameter variable declarations of builtin funcs.
...
Matches constructor setup, but I'm not really sure why we make the
variable twice.
2010-03-29 12:48:45 -07:00
Eric Anholt
76a91e1afb
Implement dot() builtin.
2010-03-29 12:48:45 -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
53afc3609d
Implement builtin length() function.
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
bfe380a721
Implement some binary gentype builtin functions.
2010-03-29 12:48:45 -07:00
Eric Anholt
2eec73f735
Implement additional unary gentype builtins.
2010-03-29 12:48:45 -07:00
Eric Anholt
c22c40015d
Implement the first builtin function: exp().
2010-03-29 12:48:45 -07:00