-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARC][IAS] Add named V9 ASI tag constants for memory instructions
This adds named ASI tag constants (such as #ASI_P and #ASI_P_L) for memory accesses. This patch adds 64-bit/V9 tag names, given that currently the majority of SPARC software targets that arch. Support for 32-bit/V8 tag names will be added in a future patch. Reviewed By: barannikov88 Differential Revision: https://reviews.llvm.org/D157235
- Loading branch information
Showing
15 changed files
with
398 additions
and
125 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
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
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,54 @@ | ||
//===- SparcASITags.td -------------------------------------*- tablegen -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This file defines the symbolic operands permitted for various kinds of | ||
// SPARCv9 ASI. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
include "llvm/TableGen/SearchableTable.td" | ||
|
||
class ASITag<string name, string alt_name, bits<8> op> { | ||
string Name = name; | ||
// A maximum of one alias is supported right now. | ||
string AltName = alt_name; | ||
bits<8> Encoding = op; | ||
} | ||
|
||
def ASITagsList : GenericTable { | ||
let FilterClass = "ASITag"; | ||
let Fields = ["Name", "AltName", "Encoding"]; | ||
|
||
let PrimaryKey = [ "Encoding" ]; | ||
let PrimaryKeyName = "lookupASITagByEncoding"; | ||
} | ||
|
||
def lookupASITagByName : SearchIndex { | ||
let Table = ASITagsList; | ||
let Key = [ "Name" ]; | ||
} | ||
|
||
def lookupASITagByAltName : SearchIndex { | ||
let Table = ASITagsList; | ||
let Key = [ "AltName" ]; | ||
} | ||
|
||
def : ASITag<"ASI_N", "ASI_NUCLEUS", 0x4>; | ||
def : ASITag<"ASI_N_L", "ASI_NUCLEUS_LITTLE", 0xC>; | ||
def : ASITag<"ASI_AIUP", "ASI_AS_IF_USER_PRIMARY", 0x10>; | ||
def : ASITag<"ASI_AIUS", "ASI_AS_IF_USER_SECONDARY", 0x11>; | ||
def : ASITag<"ASI_AIUP_L", "ASI_AS_IF_USER_PRIMARY_LITTLE", 0x18>; | ||
def : ASITag<"ASI_AIUS_L", "ASI_AS_IF_USER_SECONDARY_LITTLE", 0x19>; | ||
def : ASITag<"ASI_P", "ASI_PRIMARY", 0x80>; | ||
def : ASITag<"ASI_S", "ASI_SECONDARY", 0x81>; | ||
def : ASITag<"ASI_PNF", "ASI_PRIMARY_NOFAULT", 0x82>; | ||
def : ASITag<"ASI_SNF", "ASI_SECONDARY_NOFAULT", 0x83>; | ||
def : ASITag<"ASI_P_L", "ASI_PRIMARY_LITTLE", 0x88>; | ||
def : ASITag<"ASI_S_L", "ASI_SECONDARY_LITTLE", 0x89>; | ||
def : ASITag<"ASI_PNF_L", "ASI_PRIMARY_NOFAULT_LITTLE", 0x8A>; | ||
def : ASITag<"ASI_SNF_L", "ASI_SECONDARY_NOFAULT_LITTLE", 0x8B>; |
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,34 @@ | ||
# RUN: llvm-mc --disassemble %s -triple=sparcv9-unknown-linux | FileCheck %s --check-prefix=V9 | ||
|
||
## Disassembly prefers alternate mnemonic over explicit ASI tags | ||
## and short over long ASI tag names. | ||
# V9: casxa [%i0] #ASI_N, %l6, %o2 | ||
0xd5 0xf6 0x00 0x96 | ||
# V9: casxa [%i0] #ASI_N_L, %l6, %o2 | ||
0xd5 0xf6 0x01 0x96 | ||
# V9: casxa [%i0] #ASI_AIUP, %l6, %o2 | ||
0xd5 0xf6 0x02 0x16 | ||
# V9: casxa [%i0] #ASI_AIUS, %l6, %o2 | ||
0xd5 0xf6 0x02 0x36 | ||
# V9: casxa [%i0] #ASI_AIUP_L, %l6, %o2 | ||
0xd5 0xf6 0x03 0x16 | ||
# V9: casxa [%i0] #ASI_AIUS_L, %l6, %o2 | ||
0xd5 0xf6 0x03 0x36 | ||
## casx == casxa #ASI_P | ||
# V9: casx [%i0], %l6, %o2 | ||
0xd5 0xf6 0x10 0x16 | ||
# V9: casxa [%i0] #ASI_S, %l6, %o2 | ||
0xd5 0xf6 0x10 0x36 | ||
# V9: casxa [%i0] #ASI_PNF, %l6, %o2 | ||
0xd5 0xf6 0x10 0x56 | ||
# V9: casxa [%i0] #ASI_SNF, %l6, %o2 | ||
0xd5 0xf6 0x10 0x76 | ||
## casxl == casxa #ASI_L | ||
# V9: casxl [%i0], %l6, %o2 | ||
0xd5 0xf6 0x11 0x16 | ||
# V9: casxa [%i0] #ASI_S_L, %l6, %o2 | ||
0xd5 0xf6 0x11 0x36 | ||
# V9: casxa [%i0] #ASI_PNF_L, %l6, %o2 | ||
0xd5 0xf6 0x11 0x56 | ||
# V9: casxa [%i0] #ASI_SNF_L, %l6, %o2 | ||
0xd5 0xf6 0x11 0x76 |
Oops, something went wrong.