================
@@ -831,6 +831,65 @@ static cir::VectorType getNeonType(CIRGenFunction *cgf,
NeonTypeFlags typeFlags,
llvm_unreachable("Unknown vector element type!");
}
+// Get integer from a mlir::Value that is an int constant or a constant op.
+static int64_t getIntValueFromConstOp(mlir::Value val) {
+ return val.getDefiningOp<cir::ConstantOp>().getIntValue().getSExtValue();
+}
+
+// Build a constant shift amount vector of `vecTy` to shift a vector
+// Here `shitfVal` is a constant integer that will be splated into a
+// a const vector of `vecTy` which is the return of this function
+static mlir::Value emitNeonShiftVector(CIRGenBuilderTy &builder,
+ mlir::Value shiftVal,
+ cir::VectorType vecTy,
+ mlir::Location loc) {
+ mlir::Type eltTy = vecTy.getElementType();
+ if (shiftVal.getType() != eltTy) {
+ shiftVal = builder.createIntCast(shiftVal, eltTy);
+ }
----------------
albertbolt1 wrote:
yes we get the below error without that
error: 'cir.vec.splat' op failed to verify that type of 'value' matches element
type of 'result'
https://github.com/llvm/llvm-project/pull/186693
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits