diff --git a/flang/lib/Lower/IntrinsicCall.cpp b/flang/lib/Lower/IntrinsicCall.cpp --- a/flang/lib/Lower/IntrinsicCall.cpp +++ b/flang/lib/Lower/IntrinsicCall.cpp @@ -454,6 +454,7 @@ mlir::Value genIand(mlir::Type, llvm::ArrayRef); mlir::Value genIbits(mlir::Type, llvm::ArrayRef); mlir::Value genIbset(mlir::Type, llvm::ArrayRef); + mlir::Value genIeor(mlir::Type, llvm::ArrayRef); fir::ExtendedValue genLbound(mlir::Type, llvm::ArrayRef); fir::ExtendedValue genNull(mlir::Type, llvm::ArrayRef); fir::ExtendedValue genLen(mlir::Type, llvm::ArrayRef); @@ -611,6 +612,7 @@ {"iand", &I::genIand}, {"ibits", &I::genIbits}, {"ibset", &I::genIbset}, + {"ieor", &I::genIeor}, {"len", &I::genLen, {{{"string", asInquired}, {"kind", asValue}}}, @@ -1747,6 +1749,13 @@ return builder.create(loc, args[0], mask); } +// IEOR +mlir::Value IntrinsicLibrary::genIeor(mlir::Type resultType, + llvm::ArrayRef args) { + assert(args.size() == 2); + return builder.create(loc, args[0], args[1]); +} + // LEN // Note that this is only used for an unrestricted intrinsic LEN call. // Other uses of LEN are rewritten as descriptor inquiries by the front-end. diff --git a/flang/test/Lower/Intrinsics/ieor.f90 b/flang/test/Lower/Intrinsics/ieor.f90 new file mode 100644 --- /dev/null +++ b/flang/test/Lower/Intrinsics/ieor.f90 @@ -0,0 +1,9 @@ +! RUN: bbc -emit-fir %s -o - | FileCheck %s + +! CHECK-LABEL: ieor_test +subroutine ieor_test(a, b) + integer :: a, b + print *, ieor(a, b) + ! CHECK: %{{[0-9]+}} = arith.xori %{{[0-9]+}}, %{{[0-9]+}} : i{{(8|16|32|64|128)}} +end subroutine ieor_test +