Index: llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp =================================================================== --- llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp +++ llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp @@ -306,7 +306,7 @@ bool isIdxen() const { return isImmTy(ImmTyIdxen); } bool isAddr64() const { return isImmTy(ImmTyAddr64); } bool isOffset() const { return isImmTy(ImmTyOffset) && isUInt<16>(getImm()); } - bool isOffset0() const { return isImmTy(ImmTyOffset0) && isUInt<16>(getImm()); } + bool isOffset0() const { return isImmTy(ImmTyOffset0) && isUInt<8>(getImm()); } bool isOffset1() const { return isImmTy(ImmTyOffset1) && isUInt<8>(getImm()); } bool isOffsetU12() const { return (isImmTy(ImmTyOffset) || isImmTy(ImmTyInstOffset)) && isUInt<12>(getImm()); } Index: llvm/trunk/test/MC/AMDGPU/ds-err.s =================================================================== --- llvm/trunk/test/MC/AMDGPU/ds-err.s +++ llvm/trunk/test/MC/AMDGPU/ds-err.s @@ -5,6 +5,10 @@ // CHECK: error: invalid operand for instruction ds_add_u32 v2, v4 offset:1000000000 +// offset too big +// CHECK: error: invalid operand for instruction +ds_add_u32 v2, v4 offset:0x10000 + // offset0 twice // CHECK: error: invalid operand for instruction ds_write2_b32 v2, v4, v6 offset0:4 offset0:8 @@ -17,10 +21,18 @@ // CHECK: invalid operand for instruction ds_write2_b32 v2, v4, v6 offset0:1000000000 +// offset0 too big +// CHECK: invalid operand for instruction +ds_write2_b32 v2, v4, v6 offset0:0x100 + // offset1 too big // CHECK: invalid operand for instruction ds_write2_b32 v2, v4, v6 offset1:1000000000 +// offset1 too big +// CHECK: invalid operand for instruction +ds_write2_b32 v2, v4, v6 offset1:0x100 + //===----------------------------------------------------------------------===// // swizzle //===----------------------------------------------------------------------===//