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

Anand Shukla ashukla at cs.uiuc.edu
Tue Oct 8 11:55:01 PDT 2002


Changes in directory llvm/lib/Reoptimizer/TraceCache:

InstrUtils.cpp updated: 1.6 -> 1.7

---
Log message:

Some corrections


---
Diffs of the changes:

Index: llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp
diff -u llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp:1.6 llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp:1.7
--- llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp:1.6	Tue Oct  8 11:30:21 2002
+++ llvm/lib/Reoptimizer/TraceCache/InstrUtils.cpp	Tue Oct  8 11:54:03 2002
@@ -127,13 +127,14 @@
 }
 
 unsigned int getCallInstr(uint64_t to , uint64_t pc){
+  //check to-pc < 2^29
   if(to>pc)
-    assert((((to-pc)/4) < 2^29) && "Can't fit call target!"); 
+    assert((((to-pc)/4) < 536870912) && "Can't fit call target!"); 
   else
-    assert((((pc-to)/4) < 2^29) && "Can't fit call target!");
+    assert((((pc-to)/4) < 536870912) && "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 = 536870912; //2^29
@@ -156,44 +157,6 @@
 bool isBPR(unsigned int b){
   return ( (b&0x01c00000) == 0x00c00000);
 }
-
-
-/*
-std::pair<unsigned int, unsigned int> getBPRInstr(unsigned int b, uint64_t to, 
-                                                  uint64_t frm){
-
-  assert(isBPR(b) && "Not a predicated branch Inst!");
-  
-  unsigned int cond = (b&(234881024))>>25;//b&(2^25+2^26+2^27)
-  assert(cond !=4 && cond!=0 && cond<8 && 
-         "Incorrect cond codes for BPR Instruction!");
-
-  //forming branch!
-  //push frm by 4, because a cmp is to be inserted!
-  frm+=4;
-  uint64_t target = (to-frm)/4;
-  //target < 2^21
-  assert((target&(0x7fffffffffffffff))<2097152 && "Target out of range!");
-  
-  unsigned int inst = 
-    ((target & (2097151))|((target&(0x8000000000000000))>>42));
-  
-  inst = inst|(0x00800000);//skeleton filled in
-
-  //fill in branch type
-  if(cond<4)
-    inst = inst|(cond<<25);
-  else
-    inst = inst|((cond+4)<<25);
-  
-  //form cmp instruction: SUBcc
-  unsigned int cmp = 0x80a02000; //skeleton
-  //fill in register!
-  cmp = cmp|(b&507904);//inst|(b&(2^18+2^17+2^16+2^15+2^14))
-    
-  return std::make_pair(cmp, inst);
-}
-*/
 
 bool isBranchInstr(unsigned int y){
   return (((y & 0xc0000000) == 0) && (isBPR(y) || isNonDepJump(y) || isDepJump(y)));





More information about the llvm-commits mailing list