@@ -2648,16 +2648,18 @@ mlir::Value IntrinsicLibrary::genAbs(mlir::Type resultType,
26482648// ACOSD
26492649mlir::Value IntrinsicLibrary::genAcosd (mlir::Type resultType,
26502650 llvm::ArrayRef<mlir::Value> args) {
2651+ // maps ACOSD to ACOS * 180 / pi
26512652 assert (args.size () == 1 );
26522653 mlir::MLIRContext *context = builder.getContext ();
26532654 mlir::FunctionType ftype =
26542655 mlir::FunctionType::get (context, {resultType}, {args[0 ].getType ()});
2656+ mlir::Value result =
2657+ getRuntimeCallGenerator (" acos" , ftype)(builder, loc, {args[0 ]});
26552658 llvm::APFloat pi = llvm::APFloat (llvm::numbers::pi);
26562659 mlir::Value dfactor = builder.createRealConstant (
2657- loc, mlir::Float64Type::get (context), pi / llvm::APFloat (180.0 ));
2660+ loc, mlir::Float64Type::get (context), llvm::APFloat (180.0 ) / pi );
26582661 mlir::Value factor = builder.createConvert (loc, args[0 ].getType (), dfactor);
2659- mlir::Value arg = builder.create <mlir::arith::MulFOp>(loc, args[0 ], factor);
2660- return getRuntimeCallGenerator (" acos" , ftype)(builder, loc, {arg});
2662+ return builder.create <mlir::arith::MulFOp>(loc, result, factor);
26612663}
26622664
26632665// ADJUSTL & ADJUSTR
@@ -2799,16 +2801,18 @@ IntrinsicLibrary::genAny(mlir::Type resultType,
27992801// ASIND
28002802mlir::Value IntrinsicLibrary::genAsind (mlir::Type resultType,
28012803 llvm::ArrayRef<mlir::Value> args) {
2804+ // maps ASIND to ASIN * 180 / pi
28022805 assert (args.size () == 1 );
28032806 mlir::MLIRContext *context = builder.getContext ();
28042807 mlir::FunctionType ftype =
28052808 mlir::FunctionType::get (context, {resultType}, {args[0 ].getType ()});
2809+ mlir::Value result =
2810+ getRuntimeCallGenerator (" asin" , ftype)(builder, loc, {args[0 ]});
28062811 llvm::APFloat pi = llvm::APFloat (llvm::numbers::pi);
28072812 mlir::Value dfactor = builder.createRealConstant (
2808- loc, mlir::Float64Type::get (context), pi / llvm::APFloat (180.0 ));
2813+ loc, mlir::Float64Type::get (context), llvm::APFloat (180.0 ) / pi );
28092814 mlir::Value factor = builder.createConvert (loc, args[0 ].getType (), dfactor);
2810- mlir::Value arg = builder.create <mlir::arith::MulFOp>(loc, args[0 ], factor);
2811- return getRuntimeCallGenerator (" asin" , ftype)(builder, loc, {arg});
2815+ return builder.create <mlir::arith::MulFOp>(loc, result, factor);
28122816}
28132817
28142818// ATAND, ATAN2D
0 commit comments