From c6fa170b4db6659c411e77a9a5144ae2e92136c7 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Fri, 9 Nov 2007 08:57:19 +0000 Subject: 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 --- include/llvm/CodeGen/ValueTypes.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/llvm/CodeGen') 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. /// -- cgit v1.1