[llvm-commits] CVS: llvm/lib/Target/Sparc/SparcInstrSelectionSupport.h

Misha Brukman brukman at cs.uiuc.edu
Wed Oct 22 00:51:01 PDT 2003


Changes in directory llvm/lib/Target/Sparc:

SparcInstrSelectionSupport.h updated: 1.11 -> 1.12

---
Log message:

Add comments to describe what these functions actually do.


---
Diffs of the changes:  (+7 -0)

Index: llvm/lib/Target/Sparc/SparcInstrSelectionSupport.h
diff -u llvm/lib/Target/Sparc/SparcInstrSelectionSupport.h:1.11 llvm/lib/Target/Sparc/SparcInstrSelectionSupport.h:1.12
--- llvm/lib/Target/Sparc/SparcInstrSelectionSupport.h:1.11	Tue Oct 21 10:17:13 2003
+++ llvm/lib/Target/Sparc/SparcInstrSelectionSupport.h	Wed Oct 22 00:50:40 2003
@@ -17,6 +17,7 @@
 #include "llvm/DerivedTypes.h"
 #include "SparcInternals.h"
 
+// Choose load instruction opcode based on type of value
 inline MachineOpCode
 ChooseLoadInstruction(const Type *DestTy)
 {
@@ -39,6 +40,7 @@
   return 0;
 }
 
+// Choose store instruction opcode based on type of value
 inline MachineOpCode
 ChooseStoreInstruction(const Type *DestTy)
 {
@@ -86,6 +88,11 @@
 }
 
 
+// Because the Sparc instruction selector likes to re-write operands to
+// instructions, making them change from a Value* (virtual register) to a
+// Constant* (making an immediate field), we need to change the opcode from a
+// register-based instruction to an immediate-based instruction, hence this
+// mapping.
 static unsigned
 convertOpcodeFromRegToImm(unsigned Opcode) {
   switch (Opcode) {





More information about the llvm-commits mailing list