File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
IGC/BiFModule/Implementation/Math Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -21,20 +21,25 @@ INLINE float __intel_asinh_f32( float x, bool doFast )
21
21
22
22
if (BIF_FLAG_CTRL_GET (FastRelaxedMath ) && (!BIF_FLAG_CTRL_GET (APIRS )) && doFast )
23
23
{
24
+ float abs_x = SPIRV_OCL_BUILTIN (fabs , _f32 , )(x );
24
25
// Implemented as log(x + sqrt(x*x + 1)).
25
26
// Conformance test checks for this "overflow" case, but
26
27
// I don't think we should have to handle it.
27
- if ( x > 1500.0f )
28
+ if ( abs_x > 1500.0f )
28
29
{
29
- result = SPIRV_OCL_BUILTIN (log , _f32 , )(x ) + M_LN2_F ;
30
+ result = SPIRV_OCL_BUILTIN (log , _f32 , )(abs_x ) + M_LN2_F ;
31
+ }
32
+ else if (abs_x < 0x1.0p-12 ) {
33
+ result = abs_x ;
30
34
}
31
35
else
32
36
{
33
- result = x * x + 1.0f ;
37
+ result = abs_x * abs_x + 1.0f ;
34
38
result = SPIRV_OCL_BUILTIN (sqrt , _f32 , )( result );
35
- result = x + result ;
39
+ result = abs_x + result ;
36
40
result = SPIRV_OCL_BUILTIN (log , _f32 , )( result );
37
41
}
42
+ result = SPIRV_OCL_BUILTIN (copysign , _f32_f32 , )(result , x );
38
43
}
39
44
else
40
45
{
You can’t perform that action at this time.
0 commit comments