AMDGPU: Add comment for VOP2b operand class
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 7 Oct 2015 01:36:00 +0000 (01:36 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 7 Oct 2015 01:36:00 +0000 (01:36 +0000)
Because of the constant bus requirement, it is never legal to
use a literal constant for these instructions despite the encoding
allowing it. This was already doing the right thing, but note why.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249500 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/AMDGPU/SIInstrInfo.td

index ce1d081f4378806aaca5e2c74664777954fa3461..61e9022c47ba58ced2b713e7d3f1321f63e43a1c 100644 (file)
@@ -1187,6 +1187,11 @@ def VOP2b_I32_I1_I32_I32 : VOPProfile<[i32, i32, i32, untyped]> {
 // Write out to vcc or arbitrary SGPR and read in from vcc or
 // arbitrary SGPR.
 def VOP2b_I32_I1_I32_I32_I1 : VOPProfile<[i32, i32, i32, i1]> {
+  // We use VCSrc_32 to exclude literal constants, even though the
+  // encoding normally allows them since the implicit VCC use means
+  // using one would always violate the constant bus
+  // restriction. SGPRs are still allowed because it should
+  // technically be possible to use VCC again as src0.
   let Src0RC32 = VCSrc_32;
   let Asm32 = "$dst, vcc, $src0, $src1, vcc";
   let Asm64 = "$dst, $sdst, $src0, $src1, $src2";