[llvm] r358787 - [GlobalISel] Add IRTranslator support for G_FRINT
Jessica Paquette via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 19 14:46:12 PDT 2019
Author: paquette
Date: Fri Apr 19 14:46:12 2019
New Revision: 358787
URL: http://llvm.org/viewvc/llvm-project?rev=358787&view=rev
Log:
[GlobalISel] Add IRTranslator support for G_FRINT
Add it as a simple intrinsic, update arm64-irtranslator.ll.
Differential Revision: https://reviews.llvm.org/D60893
Modified:
llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
llvm/trunk/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll
Modified: llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp?rev=358787&r1=358786&r2=358787&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp Fri Apr 19 14:46:12 2019
@@ -790,6 +790,8 @@ unsigned IRTranslator::getSimpleIntrinsi
return TargetOpcode::G_FLOG10;
case Intrinsic::pow:
return TargetOpcode::G_FPOW;
+ case Intrinsic::rint:
+ return TargetOpcode::G_FRINT;
case Intrinsic::round:
return TargetOpcode::G_INTRINSIC_ROUND;
case Intrinsic::sin:
Modified: llvm/trunk/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll?rev=358787&r1=358786&r2=358787&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll Fri Apr 19 14:46:12 2019
@@ -2362,3 +2362,11 @@ define void @test_stacksaverestore() {
call void @llvm.stackrestore(i8* %sp)
ret void
}
+
+declare float @llvm.rint.f32(float)
+define float @test_rint_f32(float %x) {
+ ; CHECK-LABEL: name: test_rint_f32
+ ; CHECK: %{{[0-9]+}}:_(s32) = G_FRINT %{{[0-9]+}}
+ %y = call float @llvm.rint.f32(float %x)
+ ret float %y
+}
More information about the llvm-commits
mailing list