mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-03-03 01:48:15 +00:00
Implement some helpers
llvm-svn: 13738
This commit is contained in:
parent
0185a86e38
commit
84431acbf1
@ -372,7 +372,17 @@ Constant *ConstantExpr::getShr(Constant *C1, Constant *C2) {
|
||||
return get(Instruction::Shr, C1, C2);
|
||||
}
|
||||
|
||||
Constant *ConstantExpr::getUShr(Constant *C1, Constant *C2) {
|
||||
if (C1->getType()->isUnsigned()) return getShr(C1, C2);
|
||||
return getCast(getShr(getCast(C1,
|
||||
C1->getType()->getUnsignedVersion()), C2), C1->getType());
|
||||
}
|
||||
|
||||
Constant *ConstantExpr::getSShr(Constant *C1, Constant *C2) {
|
||||
if (C1->getType()->isSigned()) return getShr(C1, C2);
|
||||
return getCast(getShr(getCast(C1,
|
||||
C1->getType()->getSignedVersion()), C2), C1->getType());
|
||||
}
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
Loading…
x
Reference in New Issue
Block a user