Skip to content

Commit

Permalink
use ft3
Browse files Browse the repository at this point in the history
  • Loading branch information
superlopuh committed Nov 2, 2023
1 parent f1fa35e commit 14de4e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernels/relu/16x16xf64/snitch_stream.xdsl.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ riscv.assembly_section ".text" {
%Y_moved = riscv.mv %Y : (!riscv.reg<a1>) -> !riscv.reg<>

%zero_int = riscv.get_register : () -> !riscv.reg<zero>
%zero_float = riscv.fcvt.d.w %zero_int : (!riscv.reg<zero>) -> !riscv.freg<ft2>
%zero_float = riscv.fcvt.d.w %zero_int : (!riscv.reg<zero>) -> !riscv.freg<ft3>

%stride_pattern = "snitch_stream.stride_pattern"() {"ub" = [#int<16>, #int<16>], "strides" = [#int<128>, #int<8>], "dm" = #int<31>} : () -> !snitch_stream.stride_pattern_type
%X_stream = "snitch_stream.strided_read"(%X_moved, %stride_pattern) {"dm" = #int<0>, "rank" = #int<2>} : (!riscv.reg<>, !snitch_stream.stride_pattern_type) -> !stream.readable<!riscv.freg<ft0>>
%Y_stream = "snitch_stream.strided_write"(%Y_moved, %stride_pattern) {"dm" = #int<1>, "rank" = #int<2>} : (!riscv.reg<>, !snitch_stream.stride_pattern_type) -> !stream.writable<!riscv.freg<ft1>>
%count = riscv.li 256 : () -> !riscv.reg<>
"snitch_stream.generic"(%count, %X_stream, %Y_stream) <{"operandSegmentSizes" = array<i32: 1, 1, 1>}> ({
^0(%x : !riscv.freg<ft0>):
%res = riscv.fmax.d %x, %zero_float : (!riscv.freg<ft0>, !riscv.freg<ft2>) -> !riscv.freg<ft1>
%res = riscv.fmax.d %x, %zero_float : (!riscv.freg<ft0>, !riscv.freg<ft3>) -> !riscv.freg<ft1>
snitch_stream.yield %res : !riscv.freg<ft1>
}) : (!riscv.reg<>, !stream.readable<!riscv.freg<ft0>>, !stream.writable<!riscv.freg<ft1>>) -> ()
riscv_func.return
Expand Down

0 comments on commit 14de4e5

Please sign in to comment.