aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2003-10-22 05:50:40 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2003-10-22 05:50:40 +0000
commit0b51e4a43839fcd9b5c4c0247f96ea79ad71a4bb (patch)
treee3e5f1b2d2ee66b23c899a31707655649d6a7238 /lib
parent3494329a261db1d692052a0d7acba4725b2a7356 (diff)
Add comments to describe what these functions actually do.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9370 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/SparcV9/SparcV9InstrSelectionSupport.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Target/SparcV9/SparcV9InstrSelectionSupport.h b/lib/Target/SparcV9/SparcV9InstrSelectionSupport.h
index 7a3c081d15..d49863c1c8 100644
--- a/lib/Target/SparcV9/SparcV9InstrSelectionSupport.h
+++ b/lib/Target/SparcV9/SparcV9InstrSelectionSupport.h
@@ -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 @@ ChooseLoadInstruction(const Type *DestTy)
return 0;
}
+// Choose store instruction opcode based on type of value
inline MachineOpCode
ChooseStoreInstruction(const Type *DestTy)
{
@@ -86,6 +88,11 @@ ChooseAddInstructionByType(const Type* resultType)
}
+// 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) {