kparzysz-quic commented on a change in pull request #5353: [RUNTIME] FastRPC 
interface for Hexagon runtime
URL: https://github.com/apache/incubator-tvm/pull/5353#discussion_r410266375
 
 

 ##########
 File path: src/runtime/hexagon/target/fastrpc/src/tvm_remote_nd_imp.cc
 ##########
 @@ -0,0 +1,328 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include <assert.h>
+#include <dlfcn.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <vector>
+
+#define FARF_ERROR 1
+#include "AEEStdDef.h"
+#include "AEEStdErr.h"
+#include "HAP_farf.h"
+#include "HAP_mem.h"
+#include "HAP_perf.h"
+#include "qurt.h"
+#include "tvm_hvx.h"
+#include "tvm_remote_nd.h"
+
+struct msg_call {
+  uint32_t func_va;
+  uint32_t scalar_num;
+  uint32_t stack_num;
+  uint32_t data[];
+} __attribute__((packed));
+
+__attribute__((naked)) uint32_t launcher(volatile msg_call* mc,
+                                         uint64_t* pcc) {
+  __asm__(
+      "// This function is intentionally written to be readable,      \n"
+      "// rather than fast.                                           \n"
+      "// r0 = value of 'volatile msg_call *mc'                       \n"
+      "// r1 = address where to store the program cycle count         \n"
+      "{ memd(r29+#-16) = r21:20                                      \n"
 
 Review comment:
   This is a fairly standard packet that you'd see in a compiler-generated 
code.  Can I add a comment explaining the offset instead (what I wrote in the 
previous reply)?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to