gcc/
* config/riscv/linux.h (ICACHE_FLUSH_FUNC): New.
* config/riscv/riscv.md (clear_cache): Use it.
From-SVN: r256109
+2018-01-02 Andrew Waterman <andrew@sifive.com>
+
+ * config/riscv/linux.h (ICACHE_FLUSH_FUNC): New.
+ * config/riscv/riscv.md (clear_cache): Use it.
+
2018-01-02 Artyom Skrobov <tyomitch@gmail.com>
* web.c: Remove out-of-date comment.
#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC " -latomic "
#endif
+#define ICACHE_FLUSH_FUNC "__riscv_flush_icache"
+
#define LINK_SPEC "\
-melf" XLEN_SPEC "lriscv \
%{shared} \
(match_operand 1 "pmode_register_operand")]
""
{
+#ifdef ICACHE_FLUSH_FUNC
+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, ICACHE_FLUSH_FUNC),
+ LCT_NORMAL, VOIDmode, operands[0], Pmode,
+ operands[1], Pmode, const0_rtx, Pmode);
+#else
emit_insn (gen_fence_i ());
+#endif
DONE;
})