tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] FrozenGene commented on a change in pull request #5353: [RUNTIME] FastRPC interface for Hexagon runtime
Date Fri, 17 Apr 2020 06:59:22 GMT
FrozenGene commented on a change in pull request #5353: [RUNTIME] FastRPC interface for Hexagon
runtime
URL: https://github.com/apache/incubator-tvm/pull/5353#discussion_r410027475
 
 

 ##########
 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:
   Should be `memd(r29+#16)`? Because r29(SP) should add `+#16` to increase the address so
that we could get procedure local data on stack. Or we could use r30(FP) `-#16` to decrease
the address to get. Please note the code on the line 102, ` r21:20 = memd(r29+#16)` is right.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message