Add a function in toy language and then translate it into MLIR

if i want to add a function Max that takes two same type arguments and return the bigger one in toy language like the funtion multi_tranpose. what should i do to achieve this, are there some tutorials i can learn ? I know firstly function should be declared in ops.td, what are the following steps should i do? Thanks in advance.