[llvm] [GISEL] Add G_VSCALE instruction (PR #84542)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 10 23:09:28 PDT 2024


================
@@ -1289,6 +1289,15 @@ def G_MERGE_VALUES : GenericInstruction {
   let variadicOpsType = type1;
 }
 
+// Generic vscale.
+// Puts the value of the runtime vscale multiplied by the value in the source
+// operand into the destination register.
+def G_VSCALE : GenericInstruction {
+  let OutOperandList = (outs type0:$dst);
+  let InOperandList = (ins untyped_imm_0:$src);
----------------
topperc wrote:

I'm not sure this should be an untyped_imm_0. Does that limit the upper bound of the immediate to 64 or 32 bits? SelectionDAG folds (mul (vscale C1), C2) to (vscale C1*C2). The constant on the mul could be an APInt. So I think we need to allow the immediate to be an APInt.

I see G_CONSTANT uses unknown, but I don't know how unknown vs untyped_imm_0.

https://github.com/llvm/llvm-project/pull/84542


More information about the llvm-commits mailing list