Skip to content

Commit 3b33560

Browse files
committed
Revert "[ARM][Thumb] Save FPSCR + FPEXC for save-vfp attribute"
This reverts commit 1f05703.
1 parent 1f05703 commit 3b33560

21 files changed

+29
-1036
lines changed

clang/include/clang/Basic/Attr.td

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -994,22 +994,6 @@ def ARMInterrupt : InheritableAttr, TargetSpecificAttr<TargetARM> {
994994
let Documentation = [ARMInterruptDocs];
995995
}
996996

997-
def ARMInterruptSaveFP : InheritableAttr, TargetSpecificAttr<TargetARM> {
998-
let Spellings = [GNU<"interrupt_save_fp">];
999-
let Args = [EnumArgument<"Interrupt", "InterruptType", /*is_string=*/true,
1000-
["IRQ", "FIQ", "SWI", "ABORT", "UNDEF", ""],
1001-
["IRQ", "FIQ", "SWI", "ABORT", "UNDEF", "Generic"],
1002-
1>];
1003-
let HasCustomParsing = 0;
1004-
let Documentation = [ARMInterruptSaveFPDocs];
1005-
}
1006-
1007-
def ARMSaveFP : InheritableAttr, TargetSpecificAttr<TargetARM> {
1008-
let Spellings = [];
1009-
let Subjects = SubjectList<[Function]>;
1010-
let Documentation = [InternalOnly];
1011-
}
1012-
1013997
def AVRInterrupt : InheritableAttr, TargetSpecificAttr<TargetAVR> {
1014998
let Spellings = [GCC<"interrupt">];
1015999
let Subjects = SubjectList<[Function]>;

clang/include/clang/Basic/AttrDocs.td

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2662,19 +2662,6 @@ The semantics are as follows:
26622662
}];
26632663
}
26642664

2665-
def ARMInterruptSaveFPDocs : Documentation {
2666-
let Category = DocCatFunction;
2667-
let Heading = "interrupt_save_fp (ARM)";
2668-
let Content = [{
2669-
Clang supports the GNU style ``__attribute__((interrupt_save_fp("TYPE")))``
2670-
on ARM targets. This attribute behaves the same way as the ARM interrupt
2671-
attribute, except the general purpose floating point registers are also saved,
2672-
along with FPEXC and FPSCR. Note, even on M-class CPUs, where the floating
2673-
point context can be automatically saved depending on the FPCCR, the general
2674-
purpose floating point registers will be saved.
2675-
}];
2676-
}
2677-
26782665
def BPFPreserveAccessIndexDocs : Documentation {
26792666
let Category = DocCatFunction;
26802667
let Content = [{

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -346,14 +346,8 @@ def warn_anyx86_excessive_regsave : Warning<
346346
InGroup<DiagGroup<"excessive-regsave">>;
347347
def warn_arm_interrupt_vfp_clobber : Warning<
348348
"interrupt service routine with vfp enabled may clobber the "
349-
"interruptee's vfp state; "
350-
"consider using the `interrupt_save_fp` attribute to prevent this behavior">,
349+
"interruptee's vfp state">,
351350
InGroup<DiagGroup<"arm-interrupt-vfp-clobber">>;
352-
def warn_arm_interrupt_save_fp_without_vfp_unit : Warning<
353-
"`interrupt_save_fp` only applies to targets that have a VFP unit enabled "
354-
"for this compilation; this will be treated as a regular `interrupt` "
355-
"attribute">,
356-
InGroup<DiagGroup<"arm-interrupt-vfp-clobber">>;
357351
def err_arm_interrupt_called : Error<
358352
"interrupt service routine cannot be called directly">;
359353
def warn_interrupt_signal_attribute_invalid : Warning<

clang/lib/CodeGen/Targets/ARM.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,6 @@ class ARMTargetCodeGenInfo : public TargetCodeGenInfo {
190190

191191
Fn->addFnAttr("interrupt", Kind);
192192

193-
// Note: the ARMSaveFPAttr can only exist if we also have an interrupt
194-
// attribute
195-
const ARMSaveFPAttr *SaveFPAttr = FD->getAttr<ARMSaveFPAttr>();
196-
if (SaveFPAttr)
197-
Fn->addFnAttr("save-fp");
198-
199193
ARMABIKind ABI = getABIInfo<ARMABIInfo>().getABIKind();
200194
if (ABI == ARMABIKind::APCS)
201195
return;

clang/lib/Sema/SemaARM.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,11 +1307,9 @@ void SemaARM::handleInterruptAttr(Decl *D, const ParsedAttr &AL) {
13071307
return;
13081308
}
13091309

1310-
if (!D->hasAttr<ARMSaveFPAttr>()) {
1311-
const TargetInfo &TI = getASTContext().getTargetInfo();
1312-
if (TI.hasFeature("vfp"))
1313-
Diag(D->getLocation(), diag::warn_arm_interrupt_vfp_clobber);
1314-
}
1310+
const TargetInfo &TI = getASTContext().getTargetInfo();
1311+
if (TI.hasFeature("vfp"))
1312+
Diag(D->getLocation(), diag::warn_arm_interrupt_vfp_clobber);
13151313

13161314
D->addAttr(::new (getASTContext())
13171315
ARMInterruptAttr(getASTContext(), AL, Kind));

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5993,20 +5993,6 @@ static void handleAbiTagAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
59935993
AbiTagAttr(S.Context, AL, Tags.data(), Tags.size()));
59945994
}
59955995

5996-
static void handleARMInterruptSaveFPAttr(Sema &S, Decl *D,
5997-
const ParsedAttr &AL) {
5998-
handleARMInterruptAttr(S, D, AL);
5999-
6000-
bool VFP = S.Context.getTargetInfo().hasFeature("vfp");
6001-
6002-
if (!VFP) {
6003-
S.Diag(D->getLocation(), diag::warn_arm_interrupt_save_fp_without_vfp_unit);
6004-
return;
6005-
}
6006-
6007-
D->addAttr(::new (S.Context) ARMSaveFPAttr(S.Context, AL));
6008-
}
6009-
60105996
static bool hasBTFDeclTagAttr(Decl *D, StringRef Tag) {
60115997
for (const auto *I : D->specific_attrs<BTFDeclTagAttr>()) {
60125998
if (I->getBTFDeclTag() == Tag)
@@ -6911,9 +6897,6 @@ ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, const ParsedAttr &AL,
69116897
case ParsedAttr::AT_Interrupt:
69126898
handleInterruptAttr(S, D, AL);
69136899
break;
6914-
case ParsedAttr::AT_ARMInterruptSaveFP:
6915-
handleARMInterruptSaveFPAttr(S, D, AL);
6916-
break;
69176900
case ParsedAttr::AT_X86ForceAlignArgPointer:
69186901
S.X86().handleForceAlignArgPointerAttr(D, AL);
69196902
break;

clang/test/CodeGen/arm-interrupt-save-fp-attr-status-regs.c

Lines changed: 0 additions & 34 deletions
This file was deleted.

clang/test/CodeGen/arm-interrupt-save-fp-attr.c

Lines changed: 0 additions & 39 deletions
This file was deleted.

clang/test/Sema/arm-interrupt-attr.c

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

44

55
#ifdef __ARM_FP
6-
__attribute__((interrupt("IRQ"))) void float_irq(void); // expected-warning {{interrupt service routine with vfp enabled may clobber the interruptee's vfp state; consider using the `interrupt_save_fp` attribute to prevent this behavior}}
6+
__attribute__((interrupt("IRQ"))) void float_irq(void); // expected-warning {{interrupt service routine with vfp enabled may clobber the interruptee's vfp state}}
77
#else // !defined(__ARM_FP)
88
__attribute__((interrupt("irq"))) void foo1(void) {} // expected-warning {{'interrupt' attribute argument not supported: irq}}
99
__attribute__((interrupt(IRQ))) void foo(void) {} // expected-error {{'interrupt' attribute requires a string}}

clang/test/Sema/arm-interrupt-save-fp-attr.c

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)