vhscampos created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. vhscampos retitled this revision from "Disable bf16 when hardware FP support is missing" to "[Driver][ARM] Disable bf16 when hardware FP support is missing". vhscampos edited the summary of this revision. Herald added subscribers: danielkiss, kristof.beyls. vhscampos added a reviewer: chill.
Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D82949 Files: clang/lib/Driver/ToolChains/Arch/ARM.cpp clang/test/CodeGen/arm-bf16-softfloat.c Index: clang/test/CodeGen/arm-bf16-softfloat.c =================================================================== --- clang/test/CodeGen/arm-bf16-softfloat.c +++ clang/test/CodeGen/arm-bf16-softfloat.c @@ -1,4 +1,6 @@ -// RUN: not %clang -o %t.out -target arm-arm-eabi -march=armv8-a+bf16 -mfloat-abi=soft -c %s 2>&1 | FileCheck %s +// RUN: not %clang -target arm-arm-none-eabi -march=armv8-a+bf16 -mfloat-abi=soft -c %s -o %t 2>&1 | FileCheck %s +// RUN: not %clang -target arm-arm-none-eabi -march=armv8-a+bf16 -mfpu=none -c %s -o %t 2>&1 | FileCheck %s +// RUN: not %clang -target arm-arm-none-eabi -march=armv8-a+bf16+nofp -c %s -o %t 2>&1 | FileCheck %s // CHECK: error: __bf16 is not supported on this target extern __bf16 var; Index: clang/lib/Driver/ToolChains/Arch/ARM.cpp =================================================================== --- clang/lib/Driver/ToolChains/Arch/ARM.cpp +++ clang/lib/Driver/ToolChains/Arch/ARM.cpp @@ -301,13 +301,14 @@ // Disable all features relating to hardware FP, not already disabled by the // above call. - Features.insert(Features.end(), - {"-dotprod", "-fp16fml", "-mve", "-mve.fp", "-fpregs"}); + Features.insert(Features.end(), {"-dotprod", "-fp16fml", "-bf16", "-mve", + "-mve.fp", "-fpregs"}); } else if (FPUID == llvm::ARM::FK_NONE || checkFPDisabledInArchName(ArchName)) { // -mfpu=none or -march=armvX+nofp is *very* similar to -mfloat-abi=soft, // only that it should not disable MVE-I. - Features.insert(Features.end(), {"-dotprod", "-fp16fml", "-mve.fp"}); + Features.insert(Features.end(), + {"-dotprod", "-fp16fml", "-bf16", "-mve.fp"}); if (!hasIntegerMVE(Features)) { Features.emplace_back("-fpregs"); }
Index: clang/test/CodeGen/arm-bf16-softfloat.c =================================================================== --- clang/test/CodeGen/arm-bf16-softfloat.c +++ clang/test/CodeGen/arm-bf16-softfloat.c @@ -1,4 +1,6 @@ -// RUN: not %clang -o %t.out -target arm-arm-eabi -march=armv8-a+bf16 -mfloat-abi=soft -c %s 2>&1 | FileCheck %s +// RUN: not %clang -target arm-arm-none-eabi -march=armv8-a+bf16 -mfloat-abi=soft -c %s -o %t 2>&1 | FileCheck %s +// RUN: not %clang -target arm-arm-none-eabi -march=armv8-a+bf16 -mfpu=none -c %s -o %t 2>&1 | FileCheck %s +// RUN: not %clang -target arm-arm-none-eabi -march=armv8-a+bf16+nofp -c %s -o %t 2>&1 | FileCheck %s // CHECK: error: __bf16 is not supported on this target extern __bf16 var; Index: clang/lib/Driver/ToolChains/Arch/ARM.cpp =================================================================== --- clang/lib/Driver/ToolChains/Arch/ARM.cpp +++ clang/lib/Driver/ToolChains/Arch/ARM.cpp @@ -301,13 +301,14 @@ // Disable all features relating to hardware FP, not already disabled by the // above call. - Features.insert(Features.end(), - {"-dotprod", "-fp16fml", "-mve", "-mve.fp", "-fpregs"}); + Features.insert(Features.end(), {"-dotprod", "-fp16fml", "-bf16", "-mve", + "-mve.fp", "-fpregs"}); } else if (FPUID == llvm::ARM::FK_NONE || checkFPDisabledInArchName(ArchName)) { // -mfpu=none or -march=armvX+nofp is *very* similar to -mfloat-abi=soft, // only that it should not disable MVE-I. - Features.insert(Features.end(), {"-dotprod", "-fp16fml", "-mve.fp"}); + Features.insert(Features.end(), + {"-dotprod", "-fp16fml", "-bf16", "-mve.fp"}); if (!hasIntegerMVE(Features)) { Features.emplace_back("-fpregs"); }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits