[llvm-commits] CVS: llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp

Anand Shukla ashukla at cs.uiuc.edu
Tue Oct 8 11:31:03 PDT 2002


Changes in directory llvm/lib/Reoptimizer/TraceCache:

InstrUtils.cpp updated: 1.5 -> 1.6

---
Log message:

Added functions to time execution inside trace cache


---
Diffs of the changes:

Index: llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp
diff -u llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp:1.5 llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp:1.6
--- llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp:1.5	Sat Sep 21 00:03:55 2002
+++ llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp	Tue Oct  8 11:30:21 2002
@@ -127,12 +127,16 @@
 }
 
 unsigned int getCallInstr(uint64_t to , uint64_t pc){
-  assert((((to-pc)/4)&(2^29-1) < 2^29) && "Can't fit call target!"); 
+  if(to>pc)
+    assert((((to-pc)/4) < 2^29) && "Can't fit call target!"); 
+  else
+    assert((((pc-to)/4) < 2^29) && "Can't fit call target!");
+
   unsigned int diff = (((to-pc)/4)&0x1fffffff);
   //unsigned int sgn = ((((to-pc)/4)&(2^61))>>32);
   unsigned int sgn=0;
   if(to<pc)
-    sgn = 2^29;
+    sgn = 536870912; //2^29
   unsigned int inst = (0x40000000|diff|sgn);
   //std::cerr<<"to: "<<(void *)to<<"\t frm: "<<(void *)pc
   //       <<"\t inst"<<(void *)inst<<"\n";





More information about the llvm-commits mailing list