From: Tim Northover Date: Sun, 30 Mar 2014 08:30:28 +0000 (+0000) Subject: ARM64: uncopy/paste helper function X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=bcf0c5fd73070ad16bcf652d22999ddba71e863d;p=oota-llvm.git ARM64: uncopy/paste helper function It was doing functional but highly suspect operations on bools due to the more limited shifting operands supported by memory instructions. Should fix some MSVC warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205134 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/ARM64/MCTargetDesc/ARM64AddressingModes.h b/lib/Target/ARM64/MCTargetDesc/ARM64AddressingModes.h index 1a2edf1debe..75d0ee129ce 100644 --- a/lib/Target/ARM64/MCTargetDesc/ARM64AddressingModes.h +++ b/lib/Target/ARM64/MCTargetDesc/ARM64AddressingModes.h @@ -149,7 +149,7 @@ static inline ARM64_AM::ExtendType getMemExtendType(unsigned Imm) { } /// getExtendImm - Encode the extend type and amount for a load/store inst: -/// imm: 3-bit extend amount +/// doshift: should the offset be scaled by the access size /// shifter: 000 ==> uxtb /// 001 ==> uxth /// 010 ==> uxtw @@ -159,10 +159,9 @@ static inline ARM64_AM::ExtendType getMemExtendType(unsigned Imm) { /// 110 ==> sxtw /// 111 ==> sxtx /// {3-1} = shifter -/// {0} = imm3 -static inline unsigned getMemExtendImm(ARM64_AM::ExtendType ET, bool Imm) { - assert((Imm & 0x7) == Imm && "Illegal shifted immedate value!"); - return (unsigned(ET) << 1) | (Imm & 0x7); +/// {0} = doshift +static inline unsigned getMemExtendImm(ARM64_AM::ExtendType ET, bool DoShift) { + return (unsigned(ET) << 1) | unsigned(DoShift); } //===----------------------------------------------------------------------===//