Skip to content

Commit 9555e5b

Browse files
rebase
Created using spr 1.3.4
2 parents cb1924f + 0b43a04 commit 9555e5b

File tree

223 files changed

+4484
-1996
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

223 files changed

+4484
-1996
lines changed

clang-tools-extra/clangd/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ if (CLANGD_ENABLE_REMOTE)
210210
include(AddGRPC)
211211
endif()
212212

213+
option(CLANGD_BUILD_DEXP "Build the dexp tool as part of Clangd" ON)
214+
llvm_canonicalize_cmake_booleans(CLANGD_BUILD_DEXP)
215+
213216
if(CLANG_INCLUDE_TESTS)
214217
add_subdirectory(test)
215218
add_subdirectory(unittests)
@@ -220,4 +223,7 @@ option(CLANGD_ENABLE_REMOTE "Use gRPC library to enable remote index support for
220223
set(GRPC_INSTALL_PATH "" CACHE PATH "Path to gRPC library manual installation.")
221224

222225
add_subdirectory(index/remote)
223-
add_subdirectory(index/dex/dexp)
226+
227+
if(CLANGD_BUILD_DEXP)
228+
add_subdirectory(index/dex/dexp)
229+
endif()

clang-tools-extra/clangd/test/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@ set(CLANGD_TEST_DEPS
33
ClangdTests
44
clangd-indexer
55
split-file
6-
# No tests for it, but we should still make sure they build.
7-
dexp
86
)
97

108
if(CLANGD_BUILD_XPC)
119
list(APPEND CLANGD_TEST_DEPS clangd-xpc-test-client)
1210
list(APPEND CLANGD_TEST_DEPS ClangdXpcUnitTests)
1311
endif()
1412

13+
if(CLANGD_BUILD_DEXP)
14+
# No tests for it, but we should still make sure they build.
15+
list(APPEND CLANGD_TEST_DEPS dexp)
16+
endif()
17+
1518
if(CLANGD_ENABLE_REMOTE)
1619
list(APPEND CLANGD_TEST_DEPS clangd-index-server clangd-index-server-monitor)
1720
endif()

clang-tools-extra/clangd/test/lit.site.cfg.py.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ config.llvm_shlib_dir = "@SHLIBDIR@"
1515
config.clangd_source_dir = "@CMAKE_CURRENT_SOURCE_DIR@/.."
1616
config.clangd_binary_dir = "@CMAKE_CURRENT_BINARY_DIR@/.."
1717
config.clangd_build_xpc = @CLANGD_BUILD_XPC@
18+
config.clangd_build_dexp = @CLANGD_BUILD_DEXP@
1819
config.clangd_enable_remote = @CLANGD_ENABLE_REMOTE@
1920
config.clangd_tidy_checks = @CLANGD_TIDY_CHECKS@
2021
config.have_zlib = @LLVM_ENABLE_ZLIB@

clang/docs/LanguageExtensions.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,23 @@ of different sizes and signs is forbidden in binary and ternary builtins.
818818
T __builtin_elementwise_fmod(T x, T y) return The floating-point remainder of (x/y) whose sign floating point types
819819
matches the sign of x.
820820
T __builtin_elementwise_max(T x, T y) return x or y, whichever is larger integer and floating point types
821+
For floating point types, follows semantics of maxNum
822+
in IEEE 754-2008. See `LangRef
823+
<http://llvm.org/docs/LangRef.html#llvm-min-intrinsics-comparation>`_
824+
for the comparison.
821825
T __builtin_elementwise_min(T x, T y) return x or y, whichever is smaller integer and floating point types
826+
For floating point types, follows semantics of minNum
827+
in IEEE 754-2008. See `LangRef
828+
<http://llvm.org/docs/LangRef.html#llvm-min-intrinsics-comparation>`_
829+
for the comparison.
830+
T __builtin_elementwise_maxnum(T x, T y) return x or y, whichever is larger. Follows IEEE 754-2008 floating point types
831+
semantics (maxNum) with +0.0>-0.0. See `LangRef
832+
<http://llvm.org/docs/LangRef.html#llvm-min-intrinsics-comparation>`_
833+
for the comparison.
834+
T __builtin_elementwise_minnum(T x, T y) return x or y, whichever is smaller. Follows IEEE 754-2008 floating point types
835+
semantics (minNum) with +0.0>-0.0. See `LangRef
836+
<http://llvm.org/docs/LangRef.html#llvm-min-intrinsics-comparation>`_
837+
for the comparison.
822838
T __builtin_elementwise_add_sat(T x, T y) return the sum of x and y, clamped to the range of integer types
823839
representable values for the signed/unsigned integer type.
824840
T __builtin_elementwise_sub_sat(T x, T y) return the difference of x and y, clamped to the range of integer types

clang/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ Potentially Breaking Changes
3838
- Fix missing diagnostics for uses of declarations when performing typename access,
3939
such as when performing member access on a '[[deprecated]]' type alias.
4040
(#GH58547)
41+
- For ARM targets when compiling assembly files, the features included in the selected CPU
42+
or Architecture's FPU are included. If you wish not to use a specific feature,
43+
the relevant ``+no`` option will need to be amended to the command line option.
4144

4245
C/C++ Language Potentially Breaking Changes
4346
-------------------------------------------
@@ -191,6 +194,7 @@ Non-comprehensive list of changes in this release
191194
- Support parsing the `cc` operand modifier and alias it to the `c` modifier (#GH127719).
192195
- Added `__builtin_elementwise_exp10`.
193196
- For AMDPGU targets, added `__builtin_v_cvt_off_f32_i4` that maps to the `v_cvt_off_f32_i4` instruction.
197+
- Added `__builtin_elementwise_minnum` and `__builtin_elementwise_maxnum`.
194198

195199
New Compiler Flags
196200
------------------
@@ -511,6 +515,7 @@ X86 Support
511515

512516
Arm and AArch64 Support
513517
^^^^^^^^^^^^^^^^^^^^^^^
518+
- For ARM targets, cc1as now considers the FPU's features for the selected CPU or Architecture.
514519

515520
Android Support
516521
^^^^^^^^^^^^^^^

clang/include/clang/Basic/Builtins.td

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,6 +1304,18 @@ def ElementwiseMin : Builtin {
13041304
let Prototype = "void(...)";
13051305
}
13061306

1307+
def ElementwiseMaxNum : Builtin {
1308+
let Spellings = ["__builtin_elementwise_maxnum"];
1309+
let Attributes = [NoThrow, Const, CustomTypeChecking];
1310+
let Prototype = "void(...)";
1311+
}
1312+
1313+
def ElementwiseMinNum : Builtin {
1314+
let Spellings = ["__builtin_elementwise_minnum"];
1315+
let Attributes = [NoThrow, Const, CustomTypeChecking];
1316+
let Prototype = "void(...)";
1317+
}
1318+
13071319
def ElementwiseMaximum : Builtin {
13081320
let Spellings = ["__builtin_elementwise_maximum"];
13091321
let Attributes = [NoThrow, Const, CustomTypeChecking];

clang/include/clang/Driver/Options.td

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6881,6 +6881,13 @@ let Flags = [TargetSpecific] in {
68816881
defm android_pad_segment : BooleanFFlag<"android-pad-segment">, Group<f_Group>;
68826882
} // let Flags = [TargetSpecific]
68836883

6884+
def shared_libflangrt : Flag<["-"], "shared-libflangrt">,
6885+
HelpText<"Link the flang-rt shared library">, Group<Link_Group>,
6886+
Visibility<[FlangOption]>, Flags<[NoArgumentUnused]>;
6887+
def static_libflangrt : Flag<["-"], "static-libflangrt">,
6888+
HelpText<"Link the flang-rt static library">, Group<Link_Group>,
6889+
Visibility<[FlangOption]>, Flags<[NoArgumentUnused]>;
6890+
68846891
//===----------------------------------------------------------------------===//
68856892
// FLangOption + NoXarchOption
68866893
//===----------------------------------------------------------------------===//

clang/include/clang/Driver/ToolChain.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,10 @@ class ToolChain {
521521
addFortranRuntimeLibraryPath(const llvm::opt::ArgList &Args,
522522
llvm::opt::ArgStringList &CmdArgs) const;
523523

524+
/// Add the path for libflang_rt.runtime.a
525+
void addFlangRTLibPath(const llvm::opt::ArgList &Args,
526+
llvm::opt::ArgStringList &CmdArgs) const;
527+
524528
const char *getCompilerRTArgString(const llvm::opt::ArgList &Args,
525529
StringRef Component,
526530
FileType Type = ToolChain::FT_Static,

clang/include/clang/Support/RISCVVIntrinsicUtils.h

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include "llvm/ADT/ArrayRef.h"
1313
#include "llvm/ADT/BitmaskEnum.h"
14+
#include "llvm/ADT/Bitset.h"
1415
#include "llvm/ADT/SmallVector.h"
1516
#include "llvm/ADT/StringRef.h"
1617
#include <cstdint>
@@ -376,6 +377,8 @@ enum PolicyScheme : uint8_t {
376377
HasPolicyOperand,
377378
};
378379

380+
llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, enum PolicyScheme PS);
381+
379382
// TODO refactor RVVIntrinsic class design after support all intrinsic
380383
// combination. This represents an instantiation of an intrinsic with a
381384
// particular type and prototype
@@ -507,6 +510,23 @@ enum RVVRequire {
507510
RVV_REQ_NUM,
508511
};
509512

513+
llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, enum RVVRequire Require);
514+
515+
struct RequiredExtensionBits {
516+
llvm::Bitset<RVV_REQ_NUM> Bits;
517+
RequiredExtensionBits() {}
518+
RequiredExtensionBits(std::initializer_list<RVVRequire> Init) {
519+
for (auto I : Init)
520+
Bits.set(I);
521+
}
522+
523+
void set(unsigned I) { Bits.set(I); }
524+
bool operator[](unsigned I) const { return Bits[I]; }
525+
};
526+
527+
llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
528+
const RequiredExtensionBits &Exts);
529+
510530
// Raw RVV intrinsic info, used to expand later.
511531
// This struct is highly compact for minimized code size.
512532
struct RVVIntrinsicRecord {
@@ -518,7 +538,7 @@ struct RVVIntrinsicRecord {
518538
const char *OverloadedName;
519539

520540
// Required target features for this intrinsic.
521-
uint32_t RequiredExtensions[(RVV_REQ_NUM + 31) / 32];
541+
RequiredExtensionBits RequiredExtensions;
522542

523543
// Prototype for this intrinsic, index of RVVSignatureTable.
524544
uint16_t PrototypeIndex;

0 commit comments

Comments
 (0)