Skip to content

Commit

Permalink
8293695: Implement isInfinite intrinsic for RISC-V
Browse files Browse the repository at this point in the history
Reviewed-by: yadongwang, fyang, dsamersoff
  • Loading branch information
Aleksei Voitylov authored and Dmitry Samersoff committed Sep 15, 2022
1 parent 8f3bbe9 commit b31a03c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
26 changes: 26 additions & 0 deletions src/hotspot/cpu/riscv/riscv.ad
Original file line number Diff line number Diff line change
Expand Up @@ -7230,6 +7230,32 @@ instruct minD_reg_reg(fRegD dst, fRegD src1, fRegD src2) %{
ins_pipe(fp_dop_reg_reg_d);
%}

// Float.isInfinite
instruct isIniniteF_reg_reg(iRegINoSp dst, fRegF src)
%{
match(Set dst (IsInfiniteF src));
format %{ "isInfinite $dst, $src" %}
ins_encode %{
__ fclass_s(as_Register($dst$$reg), as_FloatRegister($src$$reg));
__ andi(as_Register($dst$$reg), as_Register($dst$$reg), 0b10000001);
__ slt(as_Register($dst$$reg), zr, as_Register($dst$$reg));
%}
ins_pipe(fp_dop_reg_reg_s);
%}

// Double.isInfinite
instruct isInfiniteD_reg_reg(iRegINoSp dst, fRegD src)
%{
match(Set dst (IsInfiniteD src));
format %{ "isInfinite $dst, $src" %}
ins_encode %{
__ fclass_d(as_Register($dst$$reg), as_FloatRegister($src$$reg));
__ andi(as_Register($dst$$reg), as_Register($dst$$reg), 0b10000001);
__ slt(as_Register($dst$$reg), zr, as_Register($dst$$reg));
%}
ins_pipe(fp_dop_reg_reg_d);
%}

instruct divF_reg_reg(fRegF dst, fRegF src1, fRegF src2) %{
match(Set dst (DivF src1 src2));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

/**
* @test
* @summary Test x86_64 intrinsics for Double methods isNaN, isFinite, isInfinite.
* @requires vm.cpu.features ~= ".*avx512dq.*"
* @summary Test intrinsics for Double methods isNaN, isFinite, isInfinite.
* @requires vm.cpu.features ~= ".*avx512dq.*" | os.arch == "riscv64"
* @library /test/lib /
* @run driver compiler.intrinsics.TestDoubleClassCheck
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

/**
* @test
* @summary Test x86_64 intrinsics for Float methods isNaN, isFinite, isInfinite.
* @requires vm.cpu.features ~= ".*avx512dq.*"
* @summary Test intrinsics for Float methods isNaN, isFinite, isInfinite.
* @requires vm.cpu.features ~= ".*avx512dq.*" | os.arch == "riscv64"
* @library /test/lib /
* @run driver compiler.intrinsics.TestFloatClassCheck
*/
Expand Down

1 comment on commit b31a03c

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.