summaryrefslogtreecommitdiffstats
path: root/llvm/test/MC/AMDGPU
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/MC/AMDGPU')
-rw-r--r--llvm/test/MC/AMDGPU/literal16-err.s21
-rw-r--r--llvm/test/MC/AMDGPU/literals.s50
-rw-r--r--llvm/test/MC/AMDGPU/literalv216-err.s20
3 files changed, 72 insertions, 19 deletions
diff --git a/llvm/test/MC/AMDGPU/literal16-err.s b/llvm/test/MC/AMDGPU/literal16-err.s
index b364e06bcb9..f9b3d40f84d 100644
--- a/llvm/test/MC/AMDGPU/literal16-err.s
+++ b/llvm/test/MC/AMDGPU/literal16-err.s
@@ -1,21 +1,28 @@
-// XFAIL: *
// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck -check-prefix=NOVI %s
v_add_f16 v1, 0xfffff, v2
-// NOVI: 19: error: invalid operand for instruction
+// NOVI: error: invalid operand for instruction
v_add_f16 v1, 0x10000, v2
-// NOVI: 19: error: invalid operand for instruction
+// NOVI: error: invalid operand for instruction
-v_add_f16 v1, v2, -0.0
-v_add_f16 v1, v2, 1
+v_add_f16 v1, 0xffffffffffff000f, v2
+// NOVI: error: invalid operand for instruction
+v_add_f16 v1, 0x1000ffff, v2
+// NOVI: error: invalid operand for instruction
-
-// FIXME: Should give truncate error
v_add_f16 v1, -32769, v2
+// NOVI: error: invalid operand for instruction
+
v_add_f16 v1, 65536, v2
+// NOVI: error: invalid operand for instruction
v_add_f32 v1, 4294967296, v2
+// NOVI: error: invalid operand for instruction
+
v_add_f32 v1, 0x0000000100000000, v2
+// NOVI: error: invalid operand for instruction
+
v_and_b32 v1, 0x0000000100000000, v2
+// NOVI: error: invalid operand for instruction
diff --git a/llvm/test/MC/AMDGPU/literals.s b/llvm/test/MC/AMDGPU/literals.s
index d5888eab6a8..21171415fcc 100644
--- a/llvm/test/MC/AMDGPU/literals.s
+++ b/llvm/test/MC/AMDGPU/literals.s
@@ -4,11 +4,11 @@
// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=CIVI --check-prefix=GFX89
// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck %s --check-prefix=GCN --check-prefix=CIVI --check-prefix=GFX89 --check-prefix=GFX9
-// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI --check-prefix=NOSICIVI
-// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSI --check-prefix=NOSICI --check-prefix=NOSICIVI
-// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICI --check-prefix=NOCIVI --check-prefix=NOSICIVI
-// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOSICIVI -check-prefix=NOVI -check-prefix=NOGFX89
-// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck %s -check-prefix=NOGFX89 -check-prefix=NOGFX9
+// RUN: not llvm-mc -arch=amdgcn -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOGCN --check-prefix=NOSI --check-prefix=NOSICI --check-prefix=NOSICIVI
+// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOGCN --check-prefix=NOSI --check-prefix=NOSICI --check-prefix=NOSICIVI
+// RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOGCN --check-prefix=NOSICI --check-prefix=NOCIVI --check-prefix=NOSICIVI
+// RUN: not llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOGCN --check-prefix=NOSICIVI --check-prefix=NOVI --check-prefix=NOGFX89
+// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOGCN --check-prefix=NOGFX89 --check-prefix=NOGFX9
//---------------------------------------------------------------------------//
// fp literal, expected fp operand
@@ -479,6 +479,46 @@ v_fract_f64 v[0:1], 0.159154943091895317852646485335
v_trunc_f32 v0, 0.159154943091895317852646485335
//---------------------------------------------------------------------------//
+// integer literal truncation checks
+//---------------------------------------------------------------------------//
+
+// NOGCN: error: invalid operand for instruction
+s_mov_b32 s0, 0x101ffffffff
+
+// NOGCN: error: invalid operand for instruction
+s_mov_b32 s0, 0x1000000001
+
+// NOGCN: error: invalid operand for instruction
+s_mov_b32 s0, 0x1000000fff
+
+// NOGCN: error: invalid operand for instruction
+v_trunc_f32 v0, 0x1fffffffff0
+
+// NOGCN: error: invalid operand for instruction
+v_trunc_f32 v0, 0x100000001
+
+// NOGCN: error: invalid operand for instruction
+v_trunc_f32 v0, 0x1fffffff000
+
+// NOGCN: error: invalid operand for instruction
+s_mov_b64 s[0:1], 0x101ffffffff
+
+// NOGCN: error: invalid operand for instruction
+s_mov_b64 s[0:1], 0x1000000001
+
+// NOGCN: error: invalid operand for instruction
+s_mov_b64 s[0:1], 0x1000000fff
+
+// NOGCN: error: invalid operand for instruction
+v_trunc_f64 v[0:1], 0x1fffffffff0
+
+// NOGCN: error: invalid operand for instruction
+v_trunc_f64 v[0:1], 0x100000001
+
+// NOGCN: error: invalid operand for instruction
+v_trunc_f64 v[0:1], 0x1fffffff000
+
+//---------------------------------------------------------------------------//
// named inline values like shared_base
//---------------------------------------------------------------------------//
diff --git a/llvm/test/MC/AMDGPU/literalv216-err.s b/llvm/test/MC/AMDGPU/literalv216-err.s
index 56951639ad2..5d5baee2472 100644
--- a/llvm/test/MC/AMDGPU/literalv216-err.s
+++ b/llvm/test/MC/AMDGPU/literalv216-err.s
@@ -1,22 +1,28 @@
// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck -check-prefix=GFX9 %s
v_pk_add_f16 v1, -17, v2
-// GFX9: :19: error: invalid operand for instruction
+// GFX9: error: invalid operand for instruction
v_pk_add_f16 v1, 65, v2
-// GFX9: :18: error: invalid operand for instruction
+// GFX9: error: invalid operand for instruction
v_pk_add_f16 v1, 64.0, v2
-// GFX9: :18: error: invalid operand for instruction
+// GFX9: error: invalid operand for instruction
v_pk_add_f16 v1, -0.15915494, v2
-// GFX9: :19: error: invalid operand for instruction
+// GFX9: error: invalid operand for instruction
v_pk_add_f16 v1, -0.0, v2
-// GFX9: :19: error: invalid operand for instruction
+// GFX9: error: invalid operand for instruction
v_pk_add_f16 v1, -32768, v2
-// GFX9: :19: error: invalid operand for instruction
+// GFX9: error: invalid operand for instruction
v_pk_add_f16 v1, 32767, v2
-// GFX9: :18: error: invalid operand for instruction
+// GFX9: error: invalid operand for instruction
+
+v_pk_add_f16 v1, 0xffffffffffff000f, v2
+// GFX9: error: invalid operand for instruction
+
+v_pk_add_f16 v1, 0x1000ffff, v2
+// GFX9: error: invalid operand for instruction
OpenPOWER on IntegriCloud