On Mon, May 06, 2019 at 04:01:58PM +0300, Алек�1557147755�й Хилаев via gcc wrote: > Gcc riscv won`t emit my insns, binutils and spike(riscv sim) work correctly, > but gcc don`t. I want to add min/max for integer, gcc compiling correct, sim > executing correctly. > > (define_insn "*min_<X:mode><GPR:mode>" > [(set (match_operand:GPR 0 "register_operand" "=r") > (smin:GPR (match_operand:X 1 "register_operand" " r") > (match_operand:X 2 "register_operand" " r")))] > "" > "min\t%0,%1,%2" > [(set_attr "type" "move") > (set_attr "mode" "<X:MODE>")])
You need to call the patterns "minsi3" and the like, if you want it to be automatically generated. Possibly combine can also make these patterns for you; look at its dump file (-fdump-rtl-combine-all) to see what it tried. Segher