[llvm-commits] [llvm] r133447 - /llvm/trunk/lib/Target/PTX/PTXInstrInfo.cpp
Justin Holewinski
justin.holewinski at gmail.com
Mon Jun 20 10:08:56 PDT 2011
Author: jholewinski
Date: Mon Jun 20 12:08:56 2011
New Revision: 133447
URL: http://llvm.org/viewvc/llvm-project?rev=133447&view=rev
Log:
PTX: Fix if-then-else formatting and add missing asserts
Modified:
llvm/trunk/lib/Target/PTX/PTXInstrInfo.cpp
Modified: llvm/trunk/lib/Target/PTX/PTXInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PTX/PTXInstrInfo.cpp?rev=133447&r1=133446&r2=133447&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PTX/PTXInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/PTX/PTXInstrInfo.cpp Mon Jun 20 12:08:56 2011
@@ -304,18 +304,16 @@
// Select the appropriate opcode based on the register class
if (RC == PTX::RegI16RegisterClass) {
OpCode = PTX::STACKSTOREI16;
- }
- else if (RC == PTX::RegI32RegisterClass) {
+ } else if (RC == PTX::RegI32RegisterClass) {
OpCode = PTX::STACKSTOREI32;
- }
- else if (RC == PTX::RegI64RegisterClass) {
+ } else if (RC == PTX::RegI64RegisterClass) {
OpCode = PTX::STACKSTOREI32;
- }
- else if (RC == PTX::RegF32RegisterClass) {
+ } else if (RC == PTX::RegF32RegisterClass) {
OpCode = PTX::STACKSTOREF32;
- }
- else if (RC == PTX::RegF64RegisterClass) {
+ } else if (RC == PTX::RegF64RegisterClass) {
OpCode = PTX::STACKSTOREF64;
+ } else {
+ llvm_unreachable("Unknown PTX register class!");
}
// Build the store instruction (really a mov)
@@ -341,18 +339,16 @@
// Select the appropriate opcode based on the register class
if (RC == PTX::RegI16RegisterClass) {
OpCode = PTX::STACKLOADI16;
- }
- else if (RC == PTX::RegI32RegisterClass) {
+ } else if (RC == PTX::RegI32RegisterClass) {
OpCode = PTX::STACKLOADI32;
- }
- else if (RC == PTX::RegI64RegisterClass) {
+ } else if (RC == PTX::RegI64RegisterClass) {
OpCode = PTX::STACKLOADI32;
- }
- else if (RC == PTX::RegF32RegisterClass) {
+ } else if (RC == PTX::RegF32RegisterClass) {
OpCode = PTX::STACKLOADF32;
- }
- else if (RC == PTX::RegF64RegisterClass) {
+ } else if (RC == PTX::RegF64RegisterClass) {
OpCode = PTX::STACKLOADF64;
+ } else {
+ llvm_unreachable("Unknown PTX register class!");
}
// Build the load instruction (really a mov)
More information about the llvm-commits
mailing list