Changed the sign extension function from mine to the provided one. Mine relied on implementation specific behavior, namely right shifting a signed value.

--HG--
extra : convert_revision : 4f5ef44d012de87919ad681024fe2ed0213a412f
This commit is contained in:
Gabe Black 2006-10-12 17:39:15 -04:00
parent 98b00d92fd
commit 92fd211a07
2 changed files with 6 additions and 6 deletions

View file

@ -80,7 +80,7 @@ output header {{
OpClass __opClass) : OpClass __opClass) :
BranchDisp(mnem, _machInst, __opClass) BranchDisp(mnem, _machInst, __opClass)
{ {
disp = sign_ext(_machInst << 2, bits + 2); disp = sext<bits + 2>((_machInst & mask(bits)) << 2);
} }
}; };
@ -95,7 +95,7 @@ output header {{
OpClass __opClass) : OpClass __opClass) :
BranchDisp(mnem, _machInst, __opClass) BranchDisp(mnem, _machInst, __opClass)
{ {
disp = sign_ext((D16HI << 16) | (D16LO << 2), 18); disp = sext<18>((D16HI << 16) | (D16LO << 2));
} }
}; };
@ -108,7 +108,7 @@ output header {{
protected: protected:
// Constructor // Constructor
BranchImm13(const char *mnem, MachInst _machInst, OpClass __opClass) : BranchImm13(const char *mnem, MachInst _machInst, OpClass __opClass) :
Branch(mnem, _machInst, __opClass), imm(sign_ext(SIMM13, 13)) Branch(mnem, _machInst, __opClass), imm(sext<13>(SIMM13))
{ {
} }

View file

@ -87,7 +87,7 @@ output header {{
OpClass __opClass) : OpClass __opClass) :
IntOpImm(mnem, _machInst, __opClass) IntOpImm(mnem, _machInst, __opClass)
{ {
imm = sign_ext(SIMM10, 10); imm = sext<10>(SIMM10);
} }
}; };
@ -102,7 +102,7 @@ output header {{
OpClass __opClass) : OpClass __opClass) :
IntOpImm(mnem, _machInst, __opClass) IntOpImm(mnem, _machInst, __opClass)
{ {
imm = sign_ext(SIMM11, 11); imm = sext<11>(SIMM11);
} }
}; };
@ -117,7 +117,7 @@ output header {{
OpClass __opClass) : OpClass __opClass) :
IntOpImm(mnem, _machInst, __opClass) IntOpImm(mnem, _machInst, __opClass)
{ {
imm = sign_ext(SIMM13, 13); imm = sext<13>(SIMM13);
} }
}; };