[PATCH] D59313: [AMDGPU][MC] Corrected checks for DS offset0 range

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 10:14:53 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL356576: [AMDGPU][MC] Corrected checks for DS offset0 range (authored by dpreobra, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D59313?vs=190455&id=191525#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59313/new/

https://reviews.llvm.org/D59313

Files:
  llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
  llvm/trunk/test/MC/AMDGPU/ds-err.s


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
 //===----------------------------------------------------------------------===//


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59313.191525.patch
Type: text/x-patch
Size: 1963 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190320/fd9a7d5e/attachment.bin>


More information about the llvm-commits mailing list