-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0037-Xtensa-Add-subtargets-ESP32.-ESP8266-and-ESP32-S2.patch
50 lines (44 loc) · 2.57 KB
/
0037-Xtensa-Add-subtargets-ESP32.-ESP8266-and-ESP32-S2.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From 062999409536b8f89edfb8f52958bd94cb5e9713 Mon Sep 17 00:00:00 2001
From: Andrei Safronov <[email protected]>
Date: Wed, 5 Apr 2023 00:58:53 +0300
Subject: [PATCH 037/158] [Xtensa] Add subtargets ESP32. ESP8266 and ESP32-S2.
Make ESP32 default subtarget.
---
llvm/lib/Target/Xtensa/Xtensa.td | 12 ++++++++++++
llvm/lib/Target/Xtensa/XtensaSubtarget.cpp | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/llvm/lib/Target/Xtensa/Xtensa.td b/llvm/lib/Target/Xtensa/Xtensa.td
index f141a6db02b5..b17442717c21 100644
--- a/llvm/lib/Target/Xtensa/Xtensa.td
+++ b/llvm/lib/Target/Xtensa/Xtensa.td
@@ -161,6 +161,18 @@ class Proc<string Name, list<SubtargetFeature> Features>
def : Proc<"generic", []>;
+def : Proc<"esp32", [FeatureDensity, FeatureSingleFloat, FeatureLoop, FeatureMAC16, FeatureWindowed, FeatureBoolean,
+ FeatureSEXT, FeatureNSA, FeatureMul32, FeatureMul32High, FeatureDFPAccel, FeatureS32C1I, FeatureTHREADPTR, FeatureDiv32,
+ FeatureATOMCTL, FeatureMEMCTL, FeatureDebug, FeatureException, FeatureHighPriInterrupts, FeatureCoprocessor,
+ FeatureInterrupt, FeatureRelocatableVector, FeatureTimerInt, FeaturePRID, FeatureRegionProtection, FeatureMiscSR]>;
+
+def : Proc<"esp8266", [FeatureDensity, FeatureNSA, FeatureMul32, FeatureExtendedL32R, FeatureDebug, FeatureException, FeatureHighPriInterrupts,
+ FeatureInterrupt, FeatureRelocatableVector, FeatureTimerInt, FeatureRegionProtection, FeaturePRID]>;
+
+def : Proc<"esp32-s2", [FeatureDensity, FeatureWindowed, FeatureSEXT, FeatureNSA, FeatureMul32, FeatureMul32High, FeatureTHREADPTR, FeatureDiv32,
+ FeatureDebug, FeatureException, FeatureHighPriInterrupts, FeatureCoprocessor, FeatureInterrupt, FeatureRelocatableVector,
+ FeatureTimerInt, FeaturePRID, FeatureRegionProtection, FeatureMiscSR]>;
+
//===----------------------------------------------------------------------===//
// Register File Description
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Target/Xtensa/XtensaSubtarget.cpp b/llvm/lib/Target/Xtensa/XtensaSubtarget.cpp
index 8c259dd33f2f..106884d8a031 100644
--- a/llvm/lib/Target/Xtensa/XtensaSubtarget.cpp
+++ b/llvm/lib/Target/Xtensa/XtensaSubtarget.cpp
@@ -29,7 +29,7 @@ XtensaSubtarget::initializeSubtargetDependencies(StringRef CPU, StringRef FS) {
StringRef CPUName = CPU;
if (CPUName.empty()) {
// set default cpu name
- CPUName = "generic";
+ CPUName = "esp32";
}
HasDensity = false;
--
2.40.1