forked from jeremyhu/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[arm] Implement ARM .arch directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197052 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
1 parent
7a4d29e
commit 61f8483
Showing
27 changed files
with
886 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
//===-- ARMArchName.def - List of the ARM arch names ------------*- C++ -*-===// | ||
// | ||
// The LLVM Compiler Infrastructure | ||
// | ||
// This file is distributed under the University of Illinois Open Source | ||
// License. See LICENSE.TXT for details. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This file contains the list of the supported ARM architecture names, | ||
// i.e. the supported value for -march= option. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// NOTE: NO INCLUDE GUARD DESIRED! | ||
|
||
#ifndef ARM_ARCH_NAME | ||
#error "You must define ARM_ARCH_NAME before including ARMArchName.def" | ||
#endif | ||
|
||
// ARM_ARCH_NAME(NAME, ID, DEFAULT_CPU_NAME, DEFAULT_CPU_ARCH) | ||
ARM_ARCH_NAME("armv2", ARMV2, "2", v4) | ||
ARM_ARCH_NAME("armv2a", ARMV2A, "2A", v4) | ||
ARM_ARCH_NAME("armv3", ARMV3, "3", v4) | ||
ARM_ARCH_NAME("armv3m", ARMV3M, "3M", v4) | ||
ARM_ARCH_NAME("armv4", ARMV4, "4", v4) | ||
ARM_ARCH_NAME("armv4t", ARMV4T, "4T", v4T) | ||
ARM_ARCH_NAME("armv5", ARMV5, "5", v5T) | ||
ARM_ARCH_NAME("armv5t", ARMV5T, "5T", v5T) | ||
ARM_ARCH_NAME("armv5te", ARMV5TE, "5TE", v5TE) | ||
ARM_ARCH_NAME("armv6", ARMV6, "6", v6) | ||
ARM_ARCH_NAME("armv6j", ARMV6J, "6J", v6) | ||
ARM_ARCH_NAME("armv6t2", ARMV6T2, "6T2", v6T2) | ||
ARM_ARCH_NAME("armv6z", ARMV6Z, "6Z", v6KZ) | ||
ARM_ARCH_NAME("armv6zk", ARMV6ZK, "6ZK", v6KZ) | ||
ARM_ARCH_NAME("armv6-m", ARMV6M, "6-M", v6_M) | ||
ARM_ARCH_NAME("armv7", ARMV7, "7", v7) | ||
ARM_ARCH_NAME("armv7-a", ARMV7A, "7-A", v7) | ||
ARM_ARCH_NAME("armv7-r", ARMV7R, "7-R", v7) | ||
ARM_ARCH_NAME("armv7-m", ARMV7M, "7-M", v7) | ||
ARM_ARCH_NAME("armv8-a", ARMV8A, "8-A", v8) | ||
ARM_ARCH_NAME("iwmmxt", IWMMXT, "iwmmxt", v5TE) | ||
ARM_ARCH_NAME("iwmmxt2", IWMMXT2, "iwmmxt2", v5TE) | ||
|
||
#undef ARM_ARCH_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//===-- ARMArchName.h - List of the ARM arch names --------------*- C++ -*-===// | ||
// | ||
// The LLVM Compiler Infrastructure | ||
// | ||
// This file is distributed under the University of Illinois Open Source | ||
// License. See LICENSE.TXT for details. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef ARMARCHNAME_H | ||
#define ARMARCHNAME_H | ||
|
||
namespace llvm { | ||
namespace ARM { | ||
|
||
enum ArchKind { | ||
INVALID_ARCH = 0 | ||
|
||
#define ARM_ARCH_NAME(NAME, ID, DEFAULT_CPU_NAME, DEFAULT_CPU_ARCH) , ID | ||
#include "ARMArchName.def" | ||
}; | ||
|
||
} // namespace ARM | ||
} // namespace llvm | ||
|
||
#endif // ARMARCHNAME_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@ Test the .arch directive for armv2 | ||
|
||
@ This test case will check the default .ARM.attributes value for the | ||
@ armv2 architecture. | ||
|
||
@ RUN: llvm-mc < %s -arch=arm -filetype=asm \ | ||
@ RUN: | FileCheck %s --check-prefix=CHECK-ASM | ||
@ RUN: llvm-mc < %s -arch=arm -filetype=obj \ | ||
@ RUN: | llvm-readobj -s -sd | FileCheck %s --check-prefix=CHECK-OBJ | ||
|
||
.syntax unified | ||
.arch armv2 | ||
|
||
@ CHECK-ASM: .arch armv2 | ||
|
||
@ CHECK-OBJ: Name: .ARM.attributes | ||
@ CHECK-OBJ: Type: SHT_ARM_ATTRIBUTES (0x70000003) | ||
@ CHECK-OBJ: Flags [ (0x0) | ||
@ CHECK-OBJ: ] | ||
@ CHECK-OBJ: Address: 0x0 | ||
@ CHECK-OBJ: Offset: 0x34 | ||
@ CHECK-OBJ: Size: 23 | ||
@ CHECK-OBJ: Link: 0 | ||
@ CHECK-OBJ: Info: 0 | ||
@ CHECK-OBJ: AddressAlignment: 1 | ||
@ CHECK-OBJ: EntrySize: 0 | ||
@ CHECK-OBJ: SectionData ( | ||
@ CHECK-OBJ: 0000: 41160000 00616561 62690001 0C000000 |A....aeabi......| | ||
@ CHECK-OBJ: 0010: 05320006 010801 |.2.....| | ||
@ CHECK-OBJ: ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@ Test the .arch directive for armv2a | ||
|
||
@ This test case will check the default .ARM.attributes value for the | ||
@ armv2a architecture. | ||
|
||
@ RUN: llvm-mc < %s -arch=arm -filetype=asm \ | ||
@ RUN: | FileCheck %s --check-prefix=CHECK-ASM | ||
@ RUN: llvm-mc < %s -arch=arm -filetype=obj \ | ||
@ RUN: | llvm-readobj -s -sd | FileCheck %s --check-prefix=CHECK-OBJ | ||
|
||
.syntax unified | ||
.arch armv2a | ||
|
||
@ CHECK-ASM: .arch armv2a | ||
|
||
@ CHECK-OBJ: Name: .ARM.attributes | ||
@ CHECK-OBJ: Type: SHT_ARM_ATTRIBUTES (0x70000003) | ||
@ CHECK-OBJ: Flags [ (0x0) | ||
@ CHECK-OBJ: ] | ||
@ CHECK-OBJ: Address: 0x0 | ||
@ CHECK-OBJ: Offset: 0x34 | ||
@ CHECK-OBJ: Size: 24 | ||
@ CHECK-OBJ: Link: 0 | ||
@ CHECK-OBJ: Info: 0 | ||
@ CHECK-OBJ: AddressAlignment: 1 | ||
@ CHECK-OBJ: EntrySize: 0 | ||
@ CHECK-OBJ: SectionData ( | ||
@ CHECK-OBJ: 0000: 41170000 00616561 62690001 0D000000 |A....aeabi......| | ||
@ CHECK-OBJ: 0010: 05324100 06010801 |.2A.....| | ||
@ CHECK-OBJ: ) |
Oops, something went wrong.