[llvm-commits] CVS: llvm/lib/Target/X86/InstSelectSimple.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Nov 26 04:44:01 PST 2002
Changes in directory llvm/lib/Target/X86:
InstSelectSimple.cpp updated: 1.37 -> 1.38
---
Log message:
brg
InstSelectSimple.cpp: Add some comments that say what I'm going to do for
calls and casts.
---
Diffs of the changes:
Index: llvm/lib/Target/X86/InstSelectSimple.cpp
diff -u llvm/lib/Target/X86/InstSelectSimple.cpp:1.37 llvm/lib/Target/X86/InstSelectSimple.cpp:1.38
--- llvm/lib/Target/X86/InstSelectSimple.cpp:1.37 Fri Nov 22 05:07:01 2002
+++ llvm/lib/Target/X86/InstSelectSimple.cpp Tue Nov 26 04:43:30 2002
@@ -363,9 +363,9 @@
}
}
-void
-ISel::visitCallInst (CallInst &CI)
-{
+/// visitCallInst - Have to push args and do a procedure call
+/// instruction, if the target address is known.
+void ISel::visitCallInst (CallInst &CI) {
visitInstruction (CI);
}
@@ -581,9 +581,39 @@
}
}
+/// visitCastInst - Here we have various kinds of copying with or without
+/// sign extension going on.
void
ISel::visitCastInst (CastInst &CI)
{
+//> cast larger int to smaller int --> copy least significant byte/word w/ mov?
+//
+//I'm not really sure what to do with this. We could insert a pseudo-op
+//that says take the low X bits of a Y bit register, but for now we can just
+//force the value into, say, EAX, then rip out AL or AX. The advantage of
+//the former is that the register allocator could use any register it wants,
+//but for now this obviously doesn't matter. :)
+
+// if target type is bool
+// Emit Compare
+// Emit Set-if-not-zero
+
+// if size of target type == size of source type
+// Emit Mov reg(target) <- reg(source)
+
+// if size of target type > size of source type
+// if both types are integer types
+// if source type is signed
+// sbyte to short, ushort: Emit movsx 8->16
+// sbyte to int, uint: Emit movsx 8->32
+// short to int, uint: Emit movsx 16->32
+// else if source type is unsigned
+// ubyte to short, ushort: Emit movzx 8->16
+// ubyte to int, uint: Emit movzx 8->32
+// ushort to int, uint: Emit movzx 16->32
+// if both types are fp types
+// float to double: Emit fstp, fld (???)
+
visitInstruction (CI);
}
More information about the llvm-commits
mailing list