winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
April 2023
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
817 discussions
Start a n
N
ew thread
Zebediah Figura : vkd3d-shader/spirv: Move spirv_compiler_destroy() to avoid forward declarations.
by Alexandre Julliard
06 Apr '23
06 Apr '23
Module: vkd3d Branch: master Commit: 28774b3649cea6764cca2f084fe30692f0616988 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/28774b3649cea6764cca2f084fe30…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Tue Feb 21 19:50:00 2023 -0600 vkd3d-shader/spirv: Move spirv_compiler_destroy() to avoid forward declarations. --- libs/vkd3d-shader/spirv.c | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index e0b39420..9504b955 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2310,7 +2310,25 @@ static const char *spirv_compiler_get_entry_point_name(const struct spirv_compil return info && info->entry_point ? info->entry_point : "main"; } -static void spirv_compiler_destroy(struct spirv_compiler *compiler); +static void spirv_compiler_destroy(struct spirv_compiler *compiler) +{ + vkd3d_free(compiler->control_flow_info); + + vkd3d_free(compiler->output_info); + + vkd3d_free(compiler->push_constants); + vkd3d_free(compiler->descriptor_offset_ids); + + vkd3d_spirv_builder_free(&compiler->spirv_builder); + + rb_destroy(&compiler->symbol_table, vkd3d_symbol_free, NULL); + + vkd3d_free(compiler->spec_constants); + + vkd3d_string_buffer_cache_cleanup(&compiler->string_buffers); + + vkd3d_free(compiler); +} static struct spirv_compiler *spirv_compiler_create(const struct vkd3d_shader_version *shader_version, const struct vkd3d_shader_desc *shader_desc, const struct vkd3d_shader_compile_info *compile_info, @@ -9938,23 +9956,3 @@ int spirv_compile(struct vkd3d_shader_parser *parser, spirv_compiler_destroy(spirv_compiler); return ret; } - -static void spirv_compiler_destroy(struct spirv_compiler *compiler) -{ - vkd3d_free(compiler->control_flow_info); - - vkd3d_free(compiler->output_info); - - vkd3d_free(compiler->push_constants); - vkd3d_free(compiler->descriptor_offset_ids); - - vkd3d_spirv_builder_free(&compiler->spirv_builder); - - rb_destroy(&compiler->symbol_table, vkd3d_symbol_free, NULL); - - vkd3d_free(compiler->spec_constants); - - vkd3d_string_buffer_cache_cleanup(&compiler->string_buffers); - - vkd3d_free(compiler); -}
1
0
0
0
Zebediah Figura : vkd3d-shader/spirv: Introduce a spirv_compile() helper.
by Alexandre Julliard
06 Apr '23
06 Apr '23
Module: vkd3d Branch: master Commit: 70cfd58be6e012fc36016ab34edce7c5c6c863b1 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/70cfd58be6e012fc36016ab34edce…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Sat Aug 6 18:39:40 2022 -0500 vkd3d-shader/spirv: Introduce a spirv_compile() helper. --- libs/vkd3d-shader/spirv.c | 29 ++++++++++++++++++++++++++--- libs/vkd3d-shader/vkd3d_shader_main.c | 13 +------------ libs/vkd3d-shader/vkd3d_shader_private.h | 12 +++--------- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index ddd77ffb..e0b39420 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2310,7 +2310,9 @@ static const char *spirv_compiler_get_entry_point_name(const struct spirv_compil return info && info->entry_point ? info->entry_point : "main"; } -struct spirv_compiler *spirv_compiler_create(const struct vkd3d_shader_version *shader_version, +static void spirv_compiler_destroy(struct spirv_compiler *compiler); + +static struct spirv_compiler *spirv_compiler_create(const struct vkd3d_shader_version *shader_version, const struct vkd3d_shader_desc *shader_desc, const struct vkd3d_shader_compile_info *compile_info, const struct vkd3d_shader_scan_descriptor_info *scan_descriptor_info, struct vkd3d_shader_message_context *message_context, const struct vkd3d_shader_location *location) @@ -9823,7 +9825,7 @@ static int spirv_compiler_handle_instruction(struct spirv_compiler *compiler, return ret; } -int spirv_compiler_generate_spirv(struct spirv_compiler *compiler, +static int spirv_compiler_generate_spirv(struct spirv_compiler *compiler, const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_parser *parser, struct vkd3d_shader_code *spirv) { @@ -9916,7 +9918,28 @@ int spirv_compiler_generate_spirv(struct spirv_compiler *compiler, return VKD3D_OK; } -void spirv_compiler_destroy(struct spirv_compiler *compiler) +int spirv_compile(struct vkd3d_shader_parser *parser, + const struct vkd3d_shader_scan_descriptor_info *scan_descriptor_info, + const struct vkd3d_shader_compile_info *compile_info, + struct vkd3d_shader_code *out, struct vkd3d_shader_message_context *message_context) +{ + struct spirv_compiler *spirv_compiler; + int ret; + + if (!(spirv_compiler = spirv_compiler_create(&parser->shader_version, &parser->shader_desc, + compile_info, scan_descriptor_info, message_context, &parser->location))) + { + ERR("Failed to create SPIR-V compiler.\n"); + return VKD3D_ERROR; + } + + ret = spirv_compiler_generate_spirv(spirv_compiler, compile_info, parser, out); + + spirv_compiler_destroy(spirv_compiler); + return ret; +} + +static void spirv_compiler_destroy(struct spirv_compiler *compiler) { vkd3d_free(compiler->control_flow_info); diff --git a/libs/vkd3d-shader/vkd3d_shader_main.c b/libs/vkd3d-shader/vkd3d_shader_main.c index 732d1cdc..b2b885aa 100644 --- a/libs/vkd3d-shader/vkd3d_shader_main.c +++ b/libs/vkd3d-shader/vkd3d_shader_main.c @@ -1173,7 +1173,6 @@ static int compile_dxbc_tpf(const struct vkd3d_shader_compile_info *compile_info { struct vkd3d_shader_scan_descriptor_info scan_descriptor_info; struct vkd3d_shader_compile_info scan_info; - struct spirv_compiler *spirv_compiler; struct vkd3d_shader_parser *parser; int ret; @@ -1223,18 +1222,8 @@ static int compile_dxbc_tpf(const struct vkd3d_shader_compile_info *compile_info return ret; } - if (!(spirv_compiler = spirv_compiler_create(&parser->shader_version, &parser->shader_desc, - compile_info, &scan_descriptor_info, message_context, &parser->location))) - { - ERR("Failed to create DXBC compiler.\n"); - vkd3d_shader_parser_destroy(parser); - vkd3d_shader_free_scan_descriptor_info(&scan_descriptor_info); - return VKD3D_ERROR; - } - - ret = spirv_compiler_generate_spirv(spirv_compiler, compile_info, parser, out); + ret = spirv_compile(parser, &scan_descriptor_info, compile_info, out, message_context); - spirv_compiler_destroy(spirv_compiler); vkd3d_shader_parser_destroy(parser); vkd3d_shader_free_scan_descriptor_info(&scan_descriptor_info); return ret; diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index e2891de2..b048d5ef 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -1150,16 +1150,10 @@ void vkd3d_glsl_generator_destroy(struct vkd3d_glsl_generator *generator); #define SPIRV_MAX_SRC_COUNT 6 -struct spirv_compiler; - -struct spirv_compiler *spirv_compiler_create(const struct vkd3d_shader_version *shader_version, - const struct vkd3d_shader_desc *shader_desc, const struct vkd3d_shader_compile_info *compile_info, +int spirv_compile(struct vkd3d_shader_parser *parser, const struct vkd3d_shader_scan_descriptor_info *scan_descriptor_info, - struct vkd3d_shader_message_context *message_context, const struct vkd3d_shader_location *location); -int spirv_compiler_generate_spirv(struct spirv_compiler *compiler, - const struct vkd3d_shader_compile_info *compile_info, struct vkd3d_shader_parser *parser, - struct vkd3d_shader_code *spirv); -void spirv_compiler_destroy(struct spirv_compiler *compiler); + const struct vkd3d_shader_compile_info *compile_info, + struct vkd3d_shader_code *out, struct vkd3d_shader_message_context *message_context); void vkd3d_compute_dxbc_checksum(const void *dxbc, size_t size, uint32_t checksum[4]);
1
0
0
0
Nikolay Sivov : vkd3d-shader/hlsl: Treat half as float for casts.
by Alexandre Julliard
06 Apr '23
06 Apr '23
Module: vkd3d Branch: master Commit: 24c1eb562f1493f60e6e93514b2ef09494cdd43b URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/24c1eb562f1493f60e6e93514b2ef…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Apr 5 00:09:55 2023 +0200 vkd3d-shader/hlsl: Treat half as float for casts. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- libs/vkd3d-shader/hlsl_sm4.c | 5 +---- tests/cast-to-half.shader_test | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/libs/vkd3d-shader/hlsl_sm4.c b/libs/vkd3d-shader/hlsl_sm4.c index 8551cfd8..dd95c308 100644 --- a/libs/vkd3d-shader/hlsl_sm4.c +++ b/libs/vkd3d-shader/hlsl_sm4.c @@ -1581,6 +1581,7 @@ static void write_sm4_cast(struct hlsl_ctx *ctx, switch (dst_type->base_type) { + case HLSL_TYPE_HALF: case HLSL_TYPE_FLOAT: switch (src_type->base_type) { @@ -1662,10 +1663,6 @@ static void write_sm4_cast(struct hlsl_ctx *ctx, } break; - case HLSL_TYPE_HALF: - hlsl_fixme(ctx, &expr->node.loc, "SM4 cast to half."); - break; - case HLSL_TYPE_DOUBLE: hlsl_fixme(ctx, &expr->node.loc, "SM4 cast to double."); break; diff --git a/tests/cast-to-half.shader_test b/tests/cast-to-half.shader_test index e2b66d4b..81d6bc5d 100644 --- a/tests/cast-to-half.shader_test +++ b/tests/cast-to-half.shader_test @@ -1,7 +1,7 @@ [require] shader model >= 4.0 -[pixel shader todo] +[pixel shader] float4 main(uniform int i, uniform uint u, uniform bool b, uniform float f) : sv_target { @@ -13,7 +13,7 @@ uniform 0 int -1 uniform 1 uint 3 uniform 2 int -2 uniform 3 float 0.5 -todo draw quad +draw quad probe all rgba (0.5, 0.5, 0.5, 0.5) [pixel shader]
1
0
0
0
Nikolay Sivov : vkd3d-shader/hlsl: Add support for ternary operator.
by Alexandre Julliard
06 Apr '23
06 Apr '23
Module: vkd3d Branch: master Commit: c190c184ce88fb5f2ac5d4c289cbf5f1799e453b URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/c190c184ce88fb5f2ac5d4c289cbf…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Apr 3 23:15:00 2023 +0200 vkd3d-shader/hlsl: Add support for ternary operator. --- Makefile.am | 1 + libs/vkd3d-shader/hlsl.y | 11 ++++++++++- tests/hlsl-ternary.shader_test | 15 +++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 77f44568..48991982 100644 --- a/Makefile.am +++ b/Makefile.am @@ -116,6 +116,7 @@ vkd3d_shader_tests = \ tests/hlsl-struct-array.shader_test \ tests/hlsl-struct-assignment.shader_test \ tests/hlsl-struct-semantics.shader_test \ + tests/hlsl-ternary.shader_test \ tests/hlsl-transpose.shader_test \ tests/hlsl-type-names.shader_test \ tests/hlsl-vector-indexing.shader_test \ diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 24108959..3873a939 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -5743,7 +5743,16 @@ conditional_expr: logicor_expr | logicor_expr '?' expr ':' assignment_expr { - hlsl_fixme(ctx, &@$, "Ternary operator."); + struct hlsl_ir_node *cond = node_from_list($1), *first = node_from_list($3), *second = node_from_list($5); + + list_move_tail($1, $3); + list_move_tail($1, $5); + vkd3d_free($3); + vkd3d_free($5); + + if (!hlsl_add_conditional(ctx, $1, cond, first, second)) + YYABORT; + $$ = $1; } assignment_expr: diff --git a/tests/hlsl-ternary.shader_test b/tests/hlsl-ternary.shader_test new file mode 100644 index 00000000..d6097165 --- /dev/null +++ b/tests/hlsl-ternary.shader_test @@ -0,0 +1,15 @@ +[pixel shader] +uniform float4 x; + +float4 main() : SV_TARGET +{ + return x.x ? x : x - 1; +} + +[test] +uniform 0 float4 2.0 3.0 4.0 5.0 +draw quad +probe all rgba (2.0, 3.0, 4.0, 5.0) +uniform 0 float4 0.0 10.0 11.0 12.0 +draw quad +probe all rgba (-1.0, 9.0, 10.0, 11.0)
1
0
0
0
Zebediah Figura : vkd3d-shader/hlsl: Introduce an hlsl_block_init() helper.
by Alexandre Julliard
06 Apr '23
06 Apr '23
Module: vkd3d Branch: master Commit: 725d4089748d6dda618347fc4a07344c8045e30f URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/725d4089748d6dda618347fc4a073…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Feb 16 17:52:15 2023 -0600 vkd3d-shader/hlsl: Introduce an hlsl_block_init() helper. --- libs/vkd3d-shader/hlsl.c | 14 +++++++------- libs/vkd3d-shader/hlsl.h | 5 +++++ libs/vkd3d-shader/hlsl_codegen.c | 6 +++--- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index 09ec2f8e..54f3292b 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -461,7 +461,7 @@ static bool init_deref_from_component_index(struct hlsl_ctx *ctx, struct hlsl_bl struct hlsl_type *path_type; struct hlsl_ir_constant *c; - list_init(&block->instrs); + hlsl_block_init(block); path_len = 0; path_type = hlsl_deref_get_type(ctx, prefix); @@ -1012,7 +1012,7 @@ struct hlsl_ir_store *hlsl_new_store_component(struct hlsl_ctx *ctx, struct hlsl struct hlsl_block comp_path_block; struct hlsl_ir_store *store; - list_init(&block->instrs); + hlsl_block_init(block); if (!(store = hlsl_alloc(ctx, sizeof(*store)))) return NULL; @@ -1150,8 +1150,8 @@ struct hlsl_ir_if *hlsl_new_if(struct hlsl_ctx *ctx, struct hlsl_ir_node *condit return NULL; init_node(&iff->node, HLSL_IR_IF, NULL, &loc); hlsl_src_from_node(&iff->condition, condition); - list_init(&iff->then_instrs.instrs); - list_init(&iff->else_instrs.instrs); + hlsl_block_init(&iff->then_instrs); + hlsl_block_init(&iff->else_instrs); return iff; } @@ -1201,7 +1201,7 @@ struct hlsl_ir_load *hlsl_new_load_component(struct hlsl_ctx *ctx, struct hlsl_b struct hlsl_block comp_path_block; struct hlsl_ir_load *load; - list_init(&block->instrs); + hlsl_block_init(block); if (!(load = hlsl_alloc(ctx, sizeof(*load)))) return NULL; @@ -1298,7 +1298,7 @@ struct hlsl_ir_loop *hlsl_new_loop(struct hlsl_ctx *ctx, struct vkd3d_shader_loc if (!(loop = hlsl_alloc(ctx, sizeof(*loop)))) return NULL; init_node(&loop->node, HLSL_IR_LOOP, NULL, &loc); - list_init(&loop->body.instrs); + hlsl_block_init(&loop->body); return loop; } @@ -1601,7 +1601,7 @@ struct hlsl_ir_function_decl *hlsl_new_func_decl(struct hlsl_ctx *ctx, if (!(decl = hlsl_alloc(ctx, sizeof(*decl)))) return NULL; - list_init(&decl->body.instrs); + hlsl_block_init(&decl->body); decl->return_type = return_type; decl->parameters = *parameters; decl->loc = *loc; diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 6c8b8da3..3e631dd9 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -857,6 +857,11 @@ static inline struct hlsl_ir_swizzle *hlsl_ir_swizzle(const struct hlsl_ir_node return CONTAINING_RECORD(node, struct hlsl_ir_swizzle, node); } +static inline void hlsl_block_init(struct hlsl_block *block) +{ + list_init(&block->instrs); +} + static inline void hlsl_block_add_instr(struct hlsl_block *block, struct hlsl_ir_node *instr) { list_add_tail(&block->instrs, &instr->entry); diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index c95ce2d8..c8550b65 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -29,7 +29,7 @@ static struct hlsl_ir_node *new_offset_from_path_index(struct hlsl_ctx *ctx, str struct hlsl_ir_node *idx_offset = NULL; struct hlsl_ir_constant *c; - list_init(&block->instrs); + hlsl_block_init(block); switch (type->class) { @@ -101,7 +101,7 @@ static struct hlsl_ir_node *new_offset_instr_from_deref(struct hlsl_ctx *ctx, st struct hlsl_type *type; unsigned int i; - list_init(&block->instrs); + hlsl_block_init(block); assert(deref->var); type = deref->var->data_type; @@ -721,7 +721,7 @@ static bool lower_calls(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void * hlsl_error(ctx, &call->node.loc, VKD3D_SHADER_ERROR_HLSL_NOT_DEFINED, "Function \"%s\" is not defined.", decl->func->name); - list_init(&block.instrs); + hlsl_block_init(&block); if (!hlsl_clone_block(ctx, &block, &decl->body)) return false; list_move_before(&call->node.entry, &block.instrs);
1
0
0
0
Zebediah Figura : vkd3d-shader/hlsl: Introduce an hlsl_block_add_block() helper.
by Alexandre Julliard
06 Apr '23
06 Apr '23
Module: vkd3d Branch: master Commit: 1da5a9a4908ec8b0707600f92f805ae67d5e7576 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/1da5a9a4908ec8b0707600f92f805…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Feb 16 18:00:01 2023 -0600 vkd3d-shader/hlsl: Introduce an hlsl_block_add_block() helper. --- libs/vkd3d-shader/hlsl.c | 4 ++-- libs/vkd3d-shader/hlsl.h | 5 +++++ libs/vkd3d-shader/hlsl_codegen.c | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index c2ee2c81..09ec2f8e 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -1023,7 +1023,7 @@ struct hlsl_ir_store *hlsl_new_store_component(struct hlsl_ctx *ctx, struct hlsl vkd3d_free(store); return NULL; } - list_move_tail(&block->instrs, &comp_path_block.instrs); + hlsl_block_add_block(block, &comp_path_block); hlsl_src_from_node(&store->rhs, rhs); if (type_is_single_reg(rhs->data_type)) @@ -1215,7 +1215,7 @@ struct hlsl_ir_load *hlsl_new_load_component(struct hlsl_ctx *ctx, struct hlsl_b vkd3d_free(load); return NULL; } - list_move_tail(&block->instrs, &comp_path_block.instrs); + hlsl_block_add_block(block, &comp_path_block); hlsl_block_add_instr(block, &load->node); diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index e9134821..6c8b8da3 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -862,6 +862,11 @@ static inline void hlsl_block_add_instr(struct hlsl_block *block, struct hlsl_ir list_add_tail(&block->instrs, &instr->entry); } +static inline void hlsl_block_add_block(struct hlsl_block *block, struct hlsl_block *add) +{ + list_move_tail(&block->instrs, &add->instrs); +} + static inline void hlsl_src_from_node(struct hlsl_src *src, struct hlsl_ir_node *node) { src->node = node; diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index be0be21e..c95ce2d8 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -114,7 +114,7 @@ static struct hlsl_ir_node *new_offset_instr_from_deref(struct hlsl_ctx *ctx, st deref->offset_regset, loc))) return NULL; - list_move_tail(&block->instrs, &idx_block.instrs); + hlsl_block_add_block(block, &idx_block); type = hlsl_get_element_type_from_path_index(ctx, type, deref->path[i].node); }
1
0
0
0
Zebediah Figura : vkd3d-shader/hlsl: Introduce an hlsl_block_add_instr() helper.
by Alexandre Julliard
06 Apr '23
06 Apr '23
Module: vkd3d Branch: master Commit: ceac81b816bac10ecb2596a0c55b20352a0d8528 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/ceac81b816bac10ecb2596a0c55b2…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Nov 11 21:13:50 2022 -0600 vkd3d-shader/hlsl: Introduce an hlsl_block_add_instr() helper. --- libs/vkd3d-shader/hlsl.c | 10 +++++----- libs/vkd3d-shader/hlsl.h | 5 +++++ libs/vkd3d-shader/hlsl.y | 2 +- libs/vkd3d-shader/hlsl_codegen.c | 24 ++++++++++++------------ 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index 6d015c20..c2ee2c81 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -490,7 +490,7 @@ static bool init_deref_from_component_index(struct hlsl_ctx *ctx, struct hlsl_bl hlsl_free_instr_list(&block->instrs); return false; } - list_add_tail(&block->instrs, &c->node.entry); + hlsl_block_add_instr(block, &c->node); hlsl_src_from_node(&deref->path[deref_path_len++], &c->node); } @@ -1029,7 +1029,7 @@ struct hlsl_ir_store *hlsl_new_store_component(struct hlsl_ctx *ctx, struct hlsl if (type_is_single_reg(rhs->data_type)) store->writemask = (1 << rhs->data_type->dimx) - 1; - list_add_tail(&block->instrs, &store->node.entry); + hlsl_block_add_instr(block, &store->node); return store; } @@ -1217,7 +1217,7 @@ struct hlsl_ir_load *hlsl_new_load_component(struct hlsl_ctx *ctx, struct hlsl_b } list_move_tail(&block->instrs, &comp_path_block.instrs); - list_add_tail(&block->instrs, &load->node.entry); + hlsl_block_add_instr(block, &load->node); return load; } @@ -1622,11 +1622,11 @@ struct hlsl_ir_function_decl *hlsl_new_func_decl(struct hlsl_ctx *ctx, if (!(constant = hlsl_new_bool_constant(ctx, false, loc))) return decl; - list_add_tail(&decl->body.instrs, &constant->node.entry); + hlsl_block_add_instr(&decl->body, &constant->node); if (!(store = hlsl_new_simple_store(ctx, decl->early_return_var, &constant->node))) return decl; - list_add_tail(&decl->body.instrs, &store->node.entry); + hlsl_block_add_instr(&decl->body, &store->node); return decl; } diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index 38a7715e..e9134821 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -857,6 +857,11 @@ static inline struct hlsl_ir_swizzle *hlsl_ir_swizzle(const struct hlsl_ir_node return CONTAINING_RECORD(node, struct hlsl_ir_swizzle, node); } +static inline void hlsl_block_add_instr(struct hlsl_block *block, struct hlsl_ir_node *instr) +{ + list_add_tail(&block->instrs, &instr->entry); +} + static inline void hlsl_src_from_node(struct hlsl_src *src, struct hlsl_ir_node *node) { src->node = node; diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 79ec970a..24108959 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -425,7 +425,7 @@ static bool append_conditional_break(struct hlsl_ctx *ctx, struct list *cond_lis if (!(jump = hlsl_new_jump(ctx, HLSL_IR_JUMP_BREAK, condition->loc))) return false; - list_add_head(&iff->then_instrs.instrs, &jump->node.entry); + hlsl_block_add_instr(&iff->then_instrs, &jump->node); return true; } diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 5d7e426f..be0be21e 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -41,11 +41,11 @@ static struct hlsl_ir_node *new_offset_from_path_index(struct hlsl_ctx *ctx, str { if (!(c = hlsl_new_uint_constant(ctx, 4, loc))) return NULL; - list_add_tail(&block->instrs, &c->node.entry); + hlsl_block_add_instr(block, &c->node); if (!(idx_offset = hlsl_new_binary_expr(ctx, HLSL_OP2_MUL, &c->node, idx))) return NULL; - list_add_tail(&block->instrs, &idx_offset->entry); + hlsl_block_add_instr(block, idx_offset); break; } @@ -56,11 +56,11 @@ static struct hlsl_ir_node *new_offset_from_path_index(struct hlsl_ctx *ctx, str if (!(c = hlsl_new_uint_constant(ctx, size, loc))) return NULL; - list_add_tail(&block->instrs, &c->node.entry); + hlsl_block_add_instr(block, &c->node); if (!(idx_offset = hlsl_new_binary_expr(ctx, HLSL_OP2_MUL, &c->node, idx))) return NULL; - list_add_tail(&block->instrs, &idx_offset->entry); + hlsl_block_add_instr(block, idx_offset); break; } @@ -72,7 +72,7 @@ static struct hlsl_ir_node *new_offset_from_path_index(struct hlsl_ctx *ctx, str if (!(c = hlsl_new_uint_constant(ctx, field->reg_offset[regset], loc))) return NULL; - list_add_tail(&block->instrs, &c->node.entry); + hlsl_block_add_instr(block, &c->node); idx_offset = &c->node; @@ -87,7 +87,7 @@ static struct hlsl_ir_node *new_offset_from_path_index(struct hlsl_ctx *ctx, str { if (!(idx_offset = hlsl_new_binary_expr(ctx, HLSL_OP2_ADD, offset, idx_offset))) return NULL; - list_add_tail(&block->instrs, &idx_offset->entry); + hlsl_block_add_instr(block, idx_offset); } return idx_offset; @@ -530,7 +530,7 @@ static void insert_early_return_break(struct hlsl_ctx *ctx, if (!(jump = hlsl_new_jump(ctx, HLSL_IR_JUMP_BREAK, cf_instr->loc))) return; - list_add_tail(&iff->then_instrs.instrs, &jump->node.entry); + hlsl_block_add_instr(&iff->then_instrs, &jump->node); } /* Remove HLSL_IR_JUMP_RETURN calls by altering subsequent control flow. */ @@ -687,15 +687,15 @@ static bool lower_return(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl *fun if (!(load = hlsl_new_var_load(ctx, func->early_return_var, cf_instr->loc))) return false; - list_add_tail(&block->instrs, &load->node.entry); + hlsl_block_add_instr(block, &load->node); if (!(not = hlsl_new_unary_expr(ctx, HLSL_OP1_LOGIC_NOT, &load->node, cf_instr->loc))) return false; - list_add_tail(&block->instrs, ¬->entry); + hlsl_block_add_instr(block, not); if (!(iff = hlsl_new_if(ctx, not, cf_instr->loc))) return false; - list_add_tail(&block->instrs, &iff->node.entry); + hlsl_block_add_instr(block, &iff->node); list_move_slice_tail(&iff->then_instrs.instrs, list_next(&block->instrs, &cf_instr->entry), tail); @@ -1943,11 +1943,11 @@ struct hlsl_ir_load *hlsl_add_conditional(struct hlsl_ctx *ctx, struct list *ins if (!(store = hlsl_new_simple_store(ctx, var, if_true))) return NULL; - list_add_tail(&iff->then_instrs.instrs, &store->node.entry); + hlsl_block_add_instr(&iff->then_instrs, &store->node); if (!(store = hlsl_new_simple_store(ctx, var, if_false))) return NULL; - list_add_tail(&iff->else_instrs.instrs, &store->node.entry); + hlsl_block_add_instr(&iff->else_instrs, &store->node); if (!(load = hlsl_new_var_load(ctx, var, condition->loc))) return NULL;
1
0
0
0
Alexandre Julliard : msvcrt: Use the fmod()/fmodf() implementation from the bundled musl library.
by Alexandre Julliard
05 Apr '23
05 Apr '23
Module: wine Branch: master Commit: b5bc026798c127d5bb4c471d94f7fb5e32b4861c URL:
https://gitlab.winehq.org/wine/wine/-/commit/b5bc026798c127d5bb4c471d94f7fb…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Apr 4 16:31:43 2023 +0200 msvcrt: Use the fmod()/fmodf() implementation from the bundled musl library. --- dlls/msvcrt/math.c | 136 --------------------------------------------- libs/musl/src/math/fmod.c | 3 + libs/musl/src/math/fmodf.c | 2 + 3 files changed, 5 insertions(+), 136 deletions(-) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 5ff75274dbc..1b3d380bc53 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -1084,74 +1084,6 @@ float CDECL expf( float x ) return y; } -/********************************************************************* - * fmodf (MSVCRT.@) - * - * Copied from musl: src/math/fmodf.c - */ -float CDECL fmodf( float x, float y ) -{ - UINT32 xi = *(UINT32*)&x; - UINT32 yi = *(UINT32*)&y; - int ex = xi>>23 & 0xff; - int ey = yi>>23 & 0xff; - UINT32 sx = xi & 0x80000000; - UINT32 i; - - if (isinf(x)) return math_error(_DOMAIN, "fmodf", x, y, (x * y) / (x * y)); - if (yi << 1 == 0 || isnan(y) || ex == 0xff) - return (x * y) / (x * y); - if (xi << 1 <= yi << 1) { - if (xi << 1 == yi << 1) - return 0 * x; - return x; - } - - /* normalize x and y */ - if (!ex) { - for (i = xi << 9; i >> 31 == 0; ex--, i <<= 1); - xi <<= -ex + 1; - } else { - xi &= -1U >> 9; - xi |= 1U << 23; - } - if (!ey) { - for (i = yi << 9; i >> 31 == 0; ey--, i <<= 1); - yi <<= -ey + 1; - } else { - yi &= -1U >> 9; - yi |= 1U << 23; - } - - /* x mod y */ - for (; ex > ey; ex--) { - i = xi - yi; - if (i >> 31 == 0) { - if (i == 0) - return 0 * x; - xi = i; - } - xi <<= 1; - } - i = xi - yi; - if (i >> 31 == 0) { - if (i == 0) - return 0 * x; - xi = i; - } - for (; xi>>23 == 0; xi <<= 1, ex--); - - /* scale result up */ - if (ex > 0) { - xi -= 1U << 23; - xi |= (UINT32)ex << 23; - } else { - xi >>= -ex + 1; - } - xi |= sx; - return *(float*)ξ -} - /********************************************************************* * logf (MSVCRT.@) * @@ -2748,74 +2680,6 @@ double CDECL exp( double x ) return scale + scale * tmp; } -/********************************************************************* - * fmod (MSVCRT.@) - * - * Copied from musl: src/math/fmod.c - */ -double CDECL fmod( double x, double y ) -{ - UINT64 xi = *(UINT64*)&x; - UINT64 yi = *(UINT64*)&y; - int ex = xi >> 52 & 0x7ff; - int ey = yi >> 52 & 0x7ff; - int sx = xi >> 63; - UINT64 i; - - if (isinf(x)) return math_error(_DOMAIN, "fmod", x, y, (x * y) / (x * y)); - if (yi << 1 == 0 || isnan(y) || ex == 0x7ff) - return (x * y) / (x * y); - if (xi << 1 <= yi << 1) { - if (xi << 1 == yi << 1) - return 0 * x; - return x; - } - - /* normalize x and y */ - if (!ex) { - for (i = xi << 12; i >> 63 == 0; ex--, i <<= 1); - xi <<= -ex + 1; - } else { - xi &= -1ULL >> 12; - xi |= 1ULL << 52; - } - if (!ey) { - for (i = yi << 12; i >> 63 == 0; ey--, i <<= 1); - yi <<= -ey + 1; - } else { - yi &= -1ULL >> 12; - yi |= 1ULL << 52; - } - - /* x mod y */ - for (; ex > ey; ex--) { - i = xi - yi; - if (i >> 63 == 0) { - if (i == 0) - return 0 * x; - xi = i; - } - xi <<= 1; - } - i = xi - yi; - if (i >> 63 == 0) { - if (i == 0) - return 0 * x; - xi = i; - } - for (; xi >> 52 == 0; xi <<= 1, ex--); - - /* scale result */ - if (ex > 0) { - xi -= 1ULL << 52; - xi |= (UINT64)ex << 52; - } else { - xi >>= -ex + 1; - } - xi |= (UINT64)sx << 63; - return *(double*)ξ -} - /********************************************************************* * log (MSVCRT.@) * diff --git a/libs/musl/src/math/fmod.c b/libs/musl/src/math/fmod.c index 89d882e2554..484f65a6b5f 100644 --- a/libs/musl/src/math/fmod.c +++ b/libs/musl/src/math/fmod.c @@ -1,5 +1,6 @@ #include <math.h> #include <stdint.h> +#include "libm.h" double __cdecl fmod(double x, double y) { @@ -13,6 +14,8 @@ double __cdecl fmod(double x, double y) /* float load/store to inner loops ruining performance and code size */ uint64_t uxi = ux.i; + if (isinf(x)) + return math_error(_DOMAIN, "fmod", x, y, (x * y) / (x * y)); if (uy.i<<1 == 0 || isnan(y) || ex == 0x7ff) return (x*y)/(x*y); if (uxi<<1 <= uy.i<<1) { diff --git a/libs/musl/src/math/fmodf.c b/libs/musl/src/math/fmodf.c index 2b79521902e..12431b06da0 100644 --- a/libs/musl/src/math/fmodf.c +++ b/libs/musl/src/math/fmodf.c @@ -11,6 +11,8 @@ float __cdecl fmodf(float x, float y) uint32_t i; uint32_t uxi = ux.i; + if (isinf(x)) + return math_error(_DOMAIN, "fmodf", x, y, (x * y) / (x * y)); if (uy.i<<1 == 0 || isnan(y) || ex == 0xff) return (x*y)/(x*y); if (uxi<<1 <= uy.i<<1) {
1
0
0
0
Alexandre Julliard : msvcrt: Use the jn()/yn() implementation from the bundled musl library.
by Alexandre Julliard
05 Apr '23
05 Apr '23
Module: wine Branch: master Commit: ec31d30ec09efe29c5dbce6ab044c0989b9fc153 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ec31d30ec09efe29c5dbce6ab044c0…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Apr 4 16:31:20 2023 +0200 msvcrt: Use the jn()/yn() implementation from the bundled musl library. --- dlls/msvcrt/math.c | 200 ------------------------------------------------ libs/musl/src/math/jn.c | 2 +- 2 files changed, 1 insertion(+), 201 deletions(-) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 4437cbbf48e..5ff75274dbc 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -5510,206 +5510,6 @@ int CDECL _isnan(double num) return (u.i & ~0ull >> 1) > 0x7ffull << 52; } -/********************************************************************* - * _jn (MSVCRT.@) - * - * Copied from musl: src/math/jn.c - */ -double CDECL _jn(int n, double x) -{ - static const double invsqrtpi = 5.64189583547756279280e-01; - - unsigned int ix, lx; - int nm1, i, sign; - double a, b, temp; - - ix = *(ULONGLONG*)&x >> 32; - lx = *(ULONGLONG*)&x; - sign = ix >> 31; - ix &= 0x7fffffff; - - if ((ix | (lx | -lx) >> 31) > 0x7ff00000) /* nan */ - return x; - - if (n == 0) - return _j0(x); - if (n < 0) { - nm1 = -(n + 1); - x = -x; - sign ^= 1; - } else { - nm1 = n-1; - } - if (nm1 == 0) - return j1(x); - - sign &= n; /* even n: 0, odd n: signbit(x) */ - x = fabs(x); - if ((ix | lx) == 0 || ix == 0x7ff00000) /* if x is 0 or inf */ - b = 0.0; - else if (nm1 < x) { - if (ix >= 0x52d00000) { /* x > 2**302 */ - switch(nm1 & 3) { - case 0: - temp = -cos(x) + sin(x); - break; - case 1: - temp = -cos(x) - sin(x); - break; - case 2: - temp = cos(x) - sin(x); - break; - default: - temp = cos(x) + sin(x); - break; - } - b = invsqrtpi * temp / sqrt(x); - } else { - a = _j0(x); - b = _j1(x); - for (i = 0; i < nm1; ) { - i++; - temp = b; - b = b * (2.0 * i / x) - a; /* avoid underflow */ - a = temp; - } - } - } else { - if (ix < 0x3e100000) { /* x < 2**-29 */ - if (nm1 > 32) /* underflow */ - b = 0.0; - else { - temp = x * 0.5; - b = temp; - a = 1.0; - for (i = 2; i <= nm1 + 1; i++) { - a *= (double)i; /* a = n! */ - b *= temp; /* b = (x/2)^n */ - } - b = b / a; - } - } else { - double t, q0, q1, w, h, z, tmp, nf; - int k; - - nf = nm1 + 1.0; - w = 2 * nf / x; - h = 2 / x; - z = w + h; - q0 = w; - q1 = w * z - 1.0; - k = 1; - while (q1 < 1.0e9) { - k += 1; - z += h; - tmp = z * q1 - q0; - q0 = q1; - q1 = tmp; - } - for (t = 0.0, i = k; i >= 0; i--) - t = 1 / (2 * (i + nf) / x - t); - a = t; - b = 1.0; - tmp = nf * log(fabs(w)); - if (tmp < 7.09782712893383973096e+02) { - for (i = nm1; i > 0; i--) { - temp = b; - b = b * (2.0 * i) / x - a; - a = temp; - } - } else { - for (i = nm1; i > 0; i--) { - temp = b; - b = b * (2.0 * i) / x - a; - a = temp; - /* scale b to avoid spurious overflow */ - if (b > 0x1p500) { - a /= b; - t /= b; - b = 1.0; - } - } - } - z = j0(x); - w = j1(x); - if (fabs(z) >= fabs(w)) - b = t * z / b; - else - b = t * w / a; - } - } - return sign ? -b : b; -} - -/********************************************************************* - * _yn (MSVCRT.@) - * - * Copied from musl: src/math/jn.c - */ -double CDECL _yn(int n, double x) -{ - static const double invsqrtpi = 5.64189583547756279280e-01; - - unsigned int ix, lx, ib; - int nm1, sign, i; - double a, b, temp; - - ix = *(ULONGLONG*)&x >> 32; - lx = *(ULONGLONG*)&x; - sign = ix >> 31; - ix &= 0x7fffffff; - - if ((ix | (lx | -lx) >> 31) > 0x7ff00000) /* nan */ - return x; - if (sign && (ix | lx) != 0) /* x < 0 */ - return math_error(_DOMAIN, "_y1", x, 0, 0 / (x - x)); - if (ix == 0x7ff00000) - return 0.0; - - if (n == 0) - return y0(x); - if (n < 0) { - nm1 = -(n + 1); - sign = n & 1; - } else { - nm1 = n - 1; - sign = 0; - } - if (nm1 == 0) - return sign ? -y1(x) : y1(x); - - if (ix >= 0x52d00000) { /* x > 2**302 */ - switch(nm1 & 3) { - case 0: - temp = -sin(x) - cos(x); - break; - case 1: - temp = -sin(x) + cos(x); - break; - case 2: - temp = sin(x) + cos(x); - break; - default: - temp = sin(x) - cos(x); - break; - } - b = invsqrtpi * temp / sqrt(x); - } else { - a = y0(x); - b = y1(x); - /* quit if b is -inf */ - ib = *(ULONGLONG*)&b >> 32; - for (i = 0; i < nm1 && ib != 0xfff00000;) { - i++; - temp = b; - b = (2.0 * i / x) * b - a; - ib = *(ULONGLONG*)&b >> 32; - a = temp; - } - } - return sign ? -b : b; -} - #if _MSVCR_VER>=120 /********************************************************************* diff --git a/libs/musl/src/math/jn.c b/libs/musl/src/math/jn.c index 55c05157be0..f7e679e25ea 100644 --- a/libs/musl/src/math/jn.c +++ b/libs/musl/src/math/jn.c @@ -225,7 +225,7 @@ double __cdecl _yn(int n, double x) if ((ix | (lx|-lx)>>31) > 0x7ff00000) /* nan */ return x; if (sign && (ix|lx)!=0) /* x < 0 */ - return 0/0.0; + return math_error(_DOMAIN, "_y1", x, 0, 0 / (x - x)); if (ix == 0x7ff00000) return 0.0;
1
0
0
0
Alexandre Julliard : msvcrt: Use the j1()/y1() implementation from the bundled musl library.
by Alexandre Julliard
05 Apr '23
05 Apr '23
Module: wine Branch: master Commit: 5895cb5e9352334d5ab4a24fe4e97fcf6d3ebfe6 URL:
https://gitlab.winehq.org/wine/wine/-/commit/5895cb5e9352334d5ab4a24fe4e97f…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Apr 4 16:30:43 2023 +0200 msvcrt: Use the j1()/y1() implementation from the bundled musl library. --- dlls/msvcrt/math.c | 275 ------------------------------------------------ libs/musl/src/math/j1.c | 8 +- 2 files changed, 5 insertions(+), 278 deletions(-)
1
0
0
0
← Newer
1
...
66
67
68
69
70
71
72
...
82
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Results per page:
10
25
50
100
200