Skip to content

Commit b98ebf3

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:c2f02e3bd6a5 into amd-gfx:f41124e56306
Local branch amd-gfx f41124e Merged main:764c7ae949a5 into amd-gfx:da777e35e28f Remote branch main c2f02e3 Clang: Define macro _MIPS_SPFPSET
2 parents f41124e + c2f02e3 commit b98ebf3

File tree

6 files changed

+80
-36
lines changed

6 files changed

+80
-36
lines changed

clang-tools-extra/docs/clang-tidy/Integrations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The following table shows the most well-known :program:`clang-tidy`
1515
integrations in detail.
1616

1717
+--------------------------------------+------------------------+---------------------------------+--------------------------+-----------------------------------------+--------------------------+
18-
| | Feature |
18+
| | Feature | | | | |
1919
+======================================+========================+=================================+==========================+=========================================+==========================+
2020
| **Tool** | On-the-fly inspection | Check list configuration (GUI) | Options to checks (GUI) | Configuration via ``.clang-tidy`` files | Custom clang-tidy binary |
2121
+--------------------------------------+------------------------+---------------------------------+--------------------------+-----------------------------------------+--------------------------+

clang-tools-extra/docs/clang-tidy/checks/readability/identifier-naming.rst

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2526,41 +2526,41 @@ Otherwise the case of this character denotes scope.
25262526
The following table is the default mapping table of Hungarian Notation which
25272527
maps Decl to its prefix string. You can also have your own style in config file.
25282528

2529-
================= ============== ====================== ============== =========== ==============
2530-
Primitive Types Microsoft data types
2531-
---------------------------------------------------------------------- --------------------------
2532-
Type Prefix Type Prefix Type Prefix
2533-
================= ============== ====================== ============== =========== ==============
2534-
int8_t i8 signed int si BOOL b
2535-
int16_t i16 signed short ss BOOLEAN b
2536-
int32_t i32 signed short int ssi BYTE by
2537-
int64_t i64 signed long long int slli CHAR c
2538-
uint8_t u8 signed long long sll UCHAR uc
2539-
uint16_t u16 signed long int sli SHORT s
2540-
uint32_t u32 signed long sl USHORT us
2541-
uint64_t u64 signed s WORD w
2542-
char8_t c8 unsigned long long int ulli DWORD dw
2543-
char16_t c16 unsigned long long ull DWORD32 dw32
2544-
char32_t c32 unsigned long int uli DWORD64 dw64
2545-
float f unsigned long ul LONG l
2546-
double d unsigned short int usi ULONG ul
2547-
char c unsigned short us ULONG32 ul32
2548-
bool b unsigned int ui ULONG64 ul64
2549-
_Bool b unsigned char uc ULONGLONG ull
2550-
int i unsigned u HANDLE h
2551-
size_t n long long int lli INT i
2552-
short s long double ld INT8 i8
2553-
signed i long long ll INT16 i16
2554-
unsigned u long int li INT32 i32
2555-
long l long l INT64 i64
2556-
long long ll ptrdiff_t p UINT ui
2557-
unsigned long ul void *none* UINT8 u8
2558-
long double ld UINT16 u16
2559-
ptrdiff_t p UINT32 u32
2560-
wchar_t wc UINT64 u64
2561-
short int si PVOID p
2529+
================= ============== ====================== ============== ============== ==============
2530+
Primitive Type Microsoft Type
2531+
----------------- -------------- ---------------------- -------------- -------------- --------------
2532+
Type Prefix Type Prefix Type Prefix
2533+
================= ============== ====================== ============== ============== ==============
2534+
int8_t i8 signed int si BOOL b
2535+
int16_t i16 signed short ss BOOLEAN b
2536+
int32_t i32 signed short int ssi BYTE by
2537+
int64_t i64 signed long long int slli CHAR c
2538+
uint8_t u8 signed long long sll UCHAR uc
2539+
uint16_t u16 signed long int sli SHORT s
2540+
uint32_t u32 signed long sl USHORT us
2541+
uint64_t u64 signed s WORD w
2542+
char8_t c8 unsigned long long int ulli DWORD dw
2543+
char16_t c16 unsigned long long ull DWORD32 dw32
2544+
char32_t c32 unsigned long int uli DWORD64 dw64
2545+
float f unsigned long ul LONG l
2546+
double d unsigned short int usi ULONG ul
2547+
char c unsigned short us ULONG32 ul32
2548+
bool b unsigned int ui ULONG64 ul64
2549+
_Bool b unsigned char uc ULONGLONG ull
2550+
int i unsigned u HANDLE h
2551+
size_t n long long int lli INT i
2552+
short s long double ld INT8 i8
2553+
signed i long long ll INT16 i16
2554+
unsigned u long int li INT32 i32
2555+
long l long l INT64 i64
2556+
long long ll ptrdiff_t p UINT ui
2557+
unsigned long ul void *none* UINT8 u8
2558+
long double ld UINT16 u16
2559+
ptrdiff_t p UINT32 u32
2560+
wchar_t wc UINT64 u64
2561+
short int si PVOID p
25622562
short s
2563-
================= ============== ====================== ============== =========== ==============
2563+
================= ============== ====================== ============== ============== ==============
25642564

25652565
**There are more trivial options for Hungarian Notation:**
25662566

clang/lib/Basic/Targets/Mips.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ void MipsTargetInfo::getTargetDefines(const LangOptions &Opts,
149149
Builder.defineMacro("_MIPS_FPSET", Twine(32));
150150
else
151151
Builder.defineMacro("_MIPS_FPSET", Twine(16));
152+
if (NoOddSpreg)
153+
Builder.defineMacro("_MIPS_SPFPSET", Twine(16));
154+
else
155+
Builder.defineMacro("_MIPS_SPFPSET", Twine(32));
152156

153157
if (IsMips16)
154158
Builder.defineMacro("__mips16", Twine(1));

clang/lib/Basic/Targets/Mips.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class LLVM_LIBRARY_VISIBILITY MipsTargetInfo : public TargetInfo {
5353
bool HasMSA;
5454
bool DisableMadd4;
5555
bool UseIndirectJumpHazard;
56+
bool NoOddSpreg;
5657

5758
protected:
5859
enum FPModeEnum { FPXX, FP32, FP64 } FPMode;
@@ -313,6 +314,8 @@ class LLVM_LIBRARY_VISIBILITY MipsTargetInfo : public TargetInfo {
313314
FloatABI = HardFloat;
314315
DspRev = NoDSP;
315316
FPMode = isFP64Default() ? FP64 : FPXX;
317+
NoOddSpreg = false;
318+
bool OddSpregGiven = false;
316319

317320
for (const auto &Feature : Features) {
318321
if (Feature == "+single-float")
@@ -349,8 +352,18 @@ class LLVM_LIBRARY_VISIBILITY MipsTargetInfo : public TargetInfo {
349352
IsNoABICalls = true;
350353
else if (Feature == "+use-indirect-jump-hazard")
351354
UseIndirectJumpHazard = true;
355+
else if (Feature == "+nooddspreg") {
356+
NoOddSpreg = true;
357+
OddSpregGiven = false;
358+
} else if (Feature == "-nooddspreg") {
359+
NoOddSpreg = false;
360+
OddSpregGiven = true;
361+
}
352362
}
353363

364+
if (FPMode == FPXX && !OddSpregGiven)
365+
NoOddSpreg = true;
366+
354367
setDataLayout();
355368

356369
return true;

clang/test/Preprocessor/init-mips.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// MIPS32BE:#define _MIPS_ARCH_MIPS32R2 1
1111
// MIPS32BE:#define _MIPS_FPSET 16
1212
// MIPS32BE:#define _MIPS_SIM _ABIO32
13+
// MIPS32BE:#define _MIPS_SPFPSET 16
1314
// MIPS32BE:#define _MIPS_SZINT 32
1415
// MIPS32BE:#define _MIPS_SZLONG 32
1516
// MIPS32BE:#define _MIPS_SZPTR 32
@@ -220,6 +221,7 @@
220221
// MIPS32EL:#define _MIPS_ARCH_MIPS32R2 1
221222
// MIPS32EL:#define _MIPS_FPSET 16
222223
// MIPS32EL:#define _MIPS_SIM _ABIO32
224+
// MIPS32EL:#define _MIPS_SPFPSET 16
223225
// MIPS32EL:#define _MIPS_SZINT 32
224226
// MIPS32EL:#define _MIPS_SZLONG 32
225227
// MIPS32EL:#define _MIPS_SZPTR 32
@@ -432,6 +434,7 @@
432434
// MIPSN32BE: #define _MIPS_FPSET 32
433435
// MIPSN32BE: #define _MIPS_ISA _MIPS_ISA_MIPS64
434436
// MIPSN32BE: #define _MIPS_SIM _ABIN32
437+
// MIPSN32BE: #define _MIPS_SPFPSET 32
435438
// MIPSN32BE: #define _MIPS_SZINT 32
436439
// MIPSN32BE: #define _MIPS_SZLONG 32
437440
// MIPSN32BE: #define _MIPS_SZPTR 32
@@ -739,6 +742,7 @@
739742
// MIPSN32EL: #define _MIPS_FPSET 32
740743
// MIPSN32EL: #define _MIPS_ISA _MIPS_ISA_MIPS64
741744
// MIPSN32EL: #define _MIPS_SIM _ABIN32
745+
// MIPSN32EL: #define _MIPS_SPFPSET 32
742746
// MIPSN32EL: #define _MIPS_SZINT 32
743747
// MIPSN32EL: #define _MIPS_SZLONG 32
744748
// MIPSN32EL: #define _MIPS_SZPTR 32
@@ -1043,6 +1047,7 @@
10431047
// MIPS64BE:#define _MIPS_ARCH_MIPS64R2 1
10441048
// MIPS64BE:#define _MIPS_FPSET 32
10451049
// MIPS64BE:#define _MIPS_SIM _ABI64
1050+
// MIPS64BE:#define _MIPS_SPFPSET 32
10461051
// MIPS64BE:#define _MIPS_SZINT 32
10471052
// MIPS64BE:#define _MIPS_SZLONG 64
10481053
// MIPS64BE:#define _MIPS_SZPTR 64
@@ -1253,6 +1258,7 @@
12531258
// MIPS64EL:#define _MIPS_ARCH_MIPS64R2 1
12541259
// MIPS64EL:#define _MIPS_FPSET 32
12551260
// MIPS64EL:#define _MIPS_SIM _ABI64
1261+
// MIPS64EL:#define _MIPS_SPFPSET 32
12561262
// MIPS64EL:#define _MIPS_SZINT 32
12571263
// MIPS64EL:#define _MIPS_SZLONG 64
12581264
// MIPS64EL:#define _MIPS_SZPTR 64
@@ -1506,6 +1512,7 @@
15061512
// MIPS-ARCH-32R6:#define _MIPS_ARCH "mips32r6"
15071513
// MIPS-ARCH-32R6:#define _MIPS_ARCH_MIPS32R6 1
15081514
// MIPS-ARCH-32R6:#define _MIPS_ISA _MIPS_ISA_MIPS32
1515+
// MIPS-ARCH-32R6:#define __mips_fpr 64
15091516
// MIPS-ARCH-32R6:#define __mips_isa_rev 6
15101517

15111518
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips64-none-none \
@@ -1682,14 +1689,28 @@
16821689
// RUN: | FileCheck -match-full-lines -check-prefix MIPS32-NOFP %s
16831690
// MIPS32-NOFP:#define __mips_fpr 0
16841691

1692+
// RUN: %clang_cc1 -target-feature -nooddspreg \
1693+
// RUN: -E -dM -triple=mips-none-none < /dev/null \
1694+
// RUN: | FileCheck -match-full-lines -check-prefix MIPS32-NOFP-ODD %s
1695+
// MIPS32-NOFP-ODD:#define _MIPS_SPFPSET 32
1696+
// MIPS32-NOFP-ODD:#define __mips_fpr 0
1697+
1698+
// RUN: %clang_cc1 -target-feature +nooddspreg -target-feature -fp64 \
1699+
// RUN: -E -dM -triple=mips-none-none < /dev/null \
1700+
// RUN: | FileCheck -match-full-lines -check-prefix MIPS32-FP64-NOODD %s
1701+
// MIPS32-FP64-NOODD:#define _MIPS_SPFPSET 16
1702+
// MIPS32-FP64-NOODD:#define __mips_fpr 32
1703+
16851704
// RUN: %clang_cc1 -target-feature +fpxx \
16861705
// RUN: -E -dM -triple=mips-none-none < /dev/null \
16871706
// RUN: | FileCheck -match-full-lines -check-prefix MIPS32-MFPXX %s
1707+
// MIPS32-MFPXX:#define _MIPS_SPFPSET 16
16881708
// MIPS32-MFPXX:#define __mips_fpr 0
16891709

16901710
// RUN: %clang_cc1 -target-cpu mips32r6 -target-feature +fpxx \
16911711
// RUN: -E -dM -triple=mips-none-none < /dev/null \
16921712
// RUN: | FileCheck -match-full-lines -check-prefix MIPS32R6-MFPXX %s
1713+
// MIPS32R6-MFPXX:#define _MIPS_SPFPSET 16
16931714
// MIPS32R6-MFPXX:#define __mips_fpr 0
16941715

16951716
// RUN: %clang_cc1 \
@@ -1716,30 +1737,35 @@
17161737
// RUN: -E -dM -triple=mips-none-none < /dev/null \
17171738
// RUN: | FileCheck -match-full-lines -check-prefix MIPS32-MFP32 %s
17181739
// MIPS32-MFP32:#define _MIPS_FPSET 16
1740+
// MIPS32-MFP32:#define _MIPS_SPFPSET 32
17191741
// MIPS32-MFP32:#define __mips_fpr 32
17201742

17211743
// RUN: %clang_cc1 -target-feature +fp64 \
17221744
// RUN: -E -dM -triple=mips-none-none < /dev/null \
17231745
// RUN: | FileCheck -match-full-lines -check-prefix MIPS32-MFP64 %s
17241746
// MIPS32-MFP64:#define _MIPS_FPSET 32
1747+
// MIPS32-MFP64:#define _MIPS_SPFPSET 32
17251748
// MIPS32-MFP64:#define __mips_fpr 64
17261749
//
17271750
// RUN: %clang_cc1 -target-feature +single-float \
17281751
// RUN: -E -dM -triple=mips-none-none < /dev/null \
17291752
// RUN: | FileCheck -match-full-lines -check-prefix MIPS32-MFP32SF %s
17301753
// MIPS32-MFP32SF:#define _MIPS_FPSET 32
1754+
// MIPS32-MFP32SF:#define _MIPS_SPFPSET 16
17311755
// MIPS32-MFP32SF:#define __mips_fpr 0
17321756

17331757
// RUN: %clang_cc1 -target-feature +fp64 \
17341758
// RUN: -E -dM -triple=mips64-none-none < /dev/null \
17351759
// RUN: | FileCheck -match-full-lines -check-prefix MIPS64-MFP64 %s
17361760
// MIPS64-MFP64:#define _MIPS_FPSET 32
1761+
// MIPS64-MFP64:#define _MIPS_SPFPSET 32
17371762
// MIPS64-MFP64:#define __mips_fpr 64
17381763

17391764
// RUN: %clang_cc1 -target-feature -fp64 -target-feature +single-float \
17401765
// RUN: -E -dM -triple=mips64-none-none < /dev/null \
17411766
// RUN: | FileCheck -match-full-lines -check-prefix MIPS64-NOMFP64 %s
17421767
// MIPS64-NOMFP64:#define _MIPS_FPSET 32
1768+
// MIPS64-NOMFP64:#define _MIPS_SPFPSET 32
17431769
// MIPS64-NOMFP64:#define __mips_fpr 32
17441770

17451771
// RUN: %clang_cc1 -target-cpu mips32r6 \
@@ -1749,6 +1775,7 @@
17491775
// RUN: -E -dM -triple=mips64-none-none < /dev/null \
17501776
// RUN: | FileCheck -match-full-lines -check-prefix MIPS-XXR6 %s
17511777
// MIPS-XXR6:#define _MIPS_FPSET 32
1778+
// MIPS-XXR6:#define _MIPS_SPFPSET 32
17521779
// MIPS-XXR6:#define __mips_fpr 64
17531780
// MIPS-XXR6:#define __mips_nan2008 1
17541781

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/* Indicate that this is LLVM compiled from the amd-gfx branch. */
1818
#define LLVM_HAVE_BRANCH_AMD_GFX
19-
#define LLVM_MAIN_REVISION 478250
19+
#define LLVM_MAIN_REVISION 478252
2020

2121
/* Define if LLVM_ENABLE_DUMP is enabled */
2222
#cmakedefine LLVM_ENABLE_DUMP

0 commit comments

Comments
 (0)