PTX: Add support for i8 type and introduce associated .b8 registers

The i8 type is required for boolean values, but can only use ld, st and mov instructions. The i1 type continues to be used for predicates.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133814 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Bailey
2011-06-24 19:27:10 +00:00
parent ef01edf1e9
commit b05a8a8f02
11 changed files with 541 additions and 15 deletions

View File

@@ -33,6 +33,7 @@ static const struct map_entry {
const TargetRegisterClass *cls;
const int opcode;
} map[] = {
{ &PTX::RegI8RegClass, PTX::MOVU8rr },
{ &PTX::RegI16RegClass, PTX::MOVU16rr },
{ &PTX::RegI32RegClass, PTX::MOVU32rr },
{ &PTX::RegI64RegClass, PTX::MOVU64rr },
@@ -302,7 +303,9 @@ void PTXInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
int OpCode;
// Select the appropriate opcode based on the register class
if (RC == PTX::RegI16RegisterClass) {
if (RC == PTX::RegI8RegisterClass) {
OpCode = PTX::STACKSTOREI8;
} else if (RC == PTX::RegI16RegisterClass) {
OpCode = PTX::STACKSTOREI16;
} else if (RC == PTX::RegI32RegisterClass) {
OpCode = PTX::STACKSTOREI32;
@@ -337,7 +340,9 @@ void PTXInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
int OpCode;
// Select the appropriate opcode based on the register class
if (RC == PTX::RegI16RegisterClass) {
if (RC == PTX::RegI8RegisterClass) {
OpCode = PTX::STACKLOADI8;
} else if (RC == PTX::RegI16RegisterClass) {
OpCode = PTX::STACKLOADI16;
} else if (RC == PTX::RegI32RegisterClass) {
OpCode = PTX::STACKLOADI32;