aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-11-09 08:57:19 +0000
committerDuncan Sands <baldrick@free.fr>2007-11-09 08:57:19 +0000
commitc6fa170b4db6659c411e77a9a5144ae2e92136c7 (patch)
tree4c3db1fd150addb8ddb1793a79cf3a443c714fb8 /include/llvm/CodeGen
parentf6bd0ce4c9a9c08500ab50cea322770c611d1af3 (diff)
downloadexternal_llvm-c6fa170b4db6659c411e77a9a5144ae2e92136c7.zip
external_llvm-c6fa170b4db6659c411e77a9a5144ae2e92136c7.tar.gz
external_llvm-c6fa170b4db6659c411e77a9a5144ae2e92136c7.tar.bz2
Fix some load/store logic that would be wrong for
apints on big-endian machines if the bitwidth is not a multiple of 8. Introduce a new helper, MVT::getStoreSizeInBits, and use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43934 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r--include/llvm/CodeGen/ValueTypes.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/ValueTypes.h b/include/llvm/CodeGen/ValueTypes.h
index 780482b..6edf97a 100644
--- a/include/llvm/CodeGen/ValueTypes.h
+++ b/include/llvm/CodeGen/ValueTypes.h
@@ -243,6 +243,13 @@ namespace MVT { // MVT = Machine Value Types
}
}
+ /// MVT::getStoreSizeInBits - Return the number of bits overwritten by a
+ /// store of the specified value type.
+ ///
+ static inline unsigned getStoreSizeInBits(ValueType VT) {
+ return (getSizeInBits(VT) + 7)/8*8;
+ }
+
/// MVT::getIntegerType - Returns the ValueType that represents an integer
/// with the given number of bits.
///