[llvm] r265368 - Lanai: fix -Wsign-compare warning

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 5 01:41:38 PDT 2016


On Tue, Apr 5, 2016 at 2:20 AM, JF Bastien via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: jfb
> Date: Mon Apr  4 19:20:27 2016
> New Revision: 265368
>
> URL: http://llvm.org/viewvc/llvm-project?rev=265368&view=rev
> Log:
> Lanai: fix -Wsign-compare warning
>
> Modified:
>     llvm/trunk/lib/Target/Lanai/LanaiInstrInfo.td
>
> Modified: llvm/trunk/lib/Target/Lanai/LanaiInstrInfo.td
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Lanai/LanaiInstrInfo.td?rev=265368&r1=265367&r2=265368&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/Lanai/LanaiInstrInfo.td (original)
> +++ llvm/trunk/lib/Target/Lanai/LanaiInstrInfo.td Mon Apr  4 19:20:27 2016
> @@ -133,7 +133,7 @@ def i32neg16 : Operand<i32>, PatLeaf<(i3
>  def i32lo16s : Operand<i32>, PatLeaf<(i32 imm), [{
>      // i32lo16 predicate - true if the 32-bit immediate has only rightmost 16
>      // bits set.
> -    return ((N->getSExtValue() & 0xFFFFUL) == N->getSExtValue());}], LO16> {
> +    return ((int64_t)(N->getSExtValue() & 0xFFFFUL) == N->getSExtValue());}], LO16> {

Can't we just drop the UL suffix and skip the cast?

>    let ParserMatchClass = LoImm16AsmOperand;
>  }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list