diff options
author | Brian <brian@yutani.localnet.net> | 2006-12-19 08:58:56 -0700 |
---|---|---|
committer | Brian <brian@yutani.localnet.net> | 2006-12-19 08:58:56 -0700 |
commit | 194bc5afbde4c6b144289e7542612ef52e0e5bd4 (patch) | |
tree | 9c49da8481234aef38a8a7b6f93228f2913d080e /src/mesa/shader/slang/library/slang_core.gc | |
parent | 8e20c417d40f8b28467591545dee76c3ffd9dfe3 (diff) |
rewrite +=, -= etc for floats
Diffstat (limited to 'src/mesa/shader/slang/library/slang_core.gc')
-rwxr-xr-x | src/mesa/shader/slang/library/slang_core.gc | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/src/mesa/shader/slang/library/slang_core.gc b/src/mesa/shader/slang/library/slang_core.gc index 81be17f9f0..3c4862baa1 100755 --- a/src/mesa/shader/slang/library/slang_core.gc +++ b/src/mesa/shader/slang/library/slang_core.gc @@ -326,30 +326,36 @@ mat4 __constructor (const vec4 r0, const vec4 r1, const vec4 r2, const vec4 r3) } +//// operator += - -void __operator += (inout float a, const float b) { - __asm float_add a, a, b; +void __operator += (inout float a, const float b) +{ + __asm vec4_add a.x, a, b; } -float __operator - (const float a) { - float b; - __asm float_negate b, a; - return b; +void __operator -= (inout float a, const float b) +{ + __asm vec4_subtract a.x, a, b; } -void __operator -= (inout float a, const float b) { - float c; - __asm float_negate c, b; - __asm float_add a, a, c; +void __operator *= (inout float a, const float b) +{ + __asm vec4_multiply a.x, a, b; } -void __operator *= (inout float a, const float b) { - __asm float_multiply a, a, b; +void __operator /= (inout float a, const float b) +{ + float w; // = 1 / b + __asm float_rcp w.x, b; + __asm vec4_multiply a.x, a, w; } -void __operator /= (inout float a, const float b) { - __asm float_divide a, a, b; + + +float __operator - (const float a) { + float b; + __asm float_negate b, a; + return b; } float __operator + (const float a, const float b) { |