Implement hyperbolic trigonometry operations.
4 unresolved threads
4 unresolved threads
I'm working on adding all the intrinsics we haven't implemented yet. Here's sinh, cosh, and tanh.
Sinh/cosh are implemented in the same commit because they forward to the same backing function (because the identities used only differ by a plus or minus).
Merge request reports
Activity
3025 static bool write_cosh_or_sinh(struct hlsl_ctx *ctx, 3026 const struct parse_initializer *params, const struct vkd3d_shader_location *loc, bool sinh_mode) 3027 { 3028 struct hlsl_ir_function_decl *func; 3029 struct hlsl_type *type; 3030 const char *fn_name, *combiner; 3031 char *body; 3032 3033 static const char template[] = 3034 "%s %s(%s x)\n" 3035 "{\n" 3036 " %s expPos, expNeg, combined;" 3037 " expPos = exp(x);\n" 3038 " expNeg = exp(-x);\n" 3039 " combined = %s;\n" 3040 " return combined / 2;\n" changed this line in version 2 of the diff
3033 static const char template[] = 3034 "%s %s(%s x)\n" 3035 "{\n" 3036 " %s expPos, expNeg, combined;" 3037 " expPos = exp(x);\n" 3038 " expNeg = exp(-x);\n" 3039 " combined = %s;\n" 3040 " return combined / 2;\n" 3041 "}\n"; 3042 static const char fn_name_sinh[] = "sinh"; 3043 static const char fn_name_cosh[] = "cosh"; 3044 static const char combiner_sinh[] = "expPos - expNeg"; 3045 static const char combiner_cosh[] = "expPos + expNeg"; 3046 3047 type = params->args[0]->data_type; 3048 type = hlsl_get_numeric_type(ctx, type->class, HLSL_TYPE_FLOAT, type->dimx, type->dimy); changed this line in version 2 of the diff
121 121 122 122 [test] 123 123 uniform 0 float4 -1.57079633 -0.54930614 0.54930614 1.57079633 124 todo(sm<6) draw quad 124 todo draw quad 125 125 probe all rgba (-0.91715234, -0.5, 0.5, 0.91715234) 2 126 126 uniform 0 float4 -10.0 -0.0 0.0 10.0 127 todo(sm<6) draw quad 127 todo draw quad added 46 commits
-
61993ce1...b1eaf832 - 44 commits from branch
wine:master
- 50abf6b2 - vkd3d-shader/hlsl: Implement hyperbolic sin and cos.
- 22349c08 - vkd3d-shader/hlsl: Implement tanh.
-
61993ce1...b1eaf832 - 44 commits from branch
added 37 commits
-
22349c08...9c0d04c8 - 35 commits from branch
wine:master
- 406fffc8 - vkd3d-shader/hlsl: Implement hyperbolic sin and cos.
- 449749e0 - vkd3d-shader/hlsl: Implement tanh.
-
22349c08...9c0d04c8 - 35 commits from branch
added 30 commits
-
64002ff4...d1e16514 - 28 commits from branch
wine:master
- 0f552304 - vkd3d-shader/hlsl: Implement hyperbolic sin and cos.
- 6aa74d86 - vkd3d-shader/hlsl: Implement tanh.
-
64002ff4...d1e16514 - 28 commits from branch
+ static const char fn_name_sinh[] = "sinh"; + static const char fn_name_cosh[] = "cosh"; + + if (!(arg = intrinsic_float_convert_arg(ctx, params, params->args[0], loc))) + return false; + type = arg->data_type; + + fn_name = sinh_mode ? fn_name_sinh : fn_name_cosh; + combiner = sinh_mode ? "-" : "+"; + + if (!(body = hlsl_sprintf_alloc(ctx, template, + type->name, fn_name, type->name, + combiner))) + return false;
So
type_name = arg->data_type->name; if (!(body = hlsl_sprintf_alloc(ctx, template, type_name, sinh_mode ? "sinh" : "cosh", type_name, sinh_mode ? "-" : "+"))) return false;
right?
added 40 commits
-
6aa74d86...2b7d9790 - 38 commits from branch
wine:master
- bb10f3f3 - vkd3d-shader/hlsl: Implement hyperbolic sin and cos.
- 62c13a37 - vkd3d-shader/hlsl: Implement tanh.
-
6aa74d86...2b7d9790 - 38 commits from branch
Please register or sign in to reply