/* Authors : Vinod.G, Arjun Menon, Aditya Govardhan Email : g.vinod1993@gmail.com, c.arjunmenon@gmail.com Last Update : 27th November 2017 See LICENSE for more details Description: TODO */ package fpu_compare_min_max; import defined_types::*; `include "core_parameters.bsv" interface Ifc_fpu_compare_min_max#(numeric type fpinp, numeric type fpman, numeric type fpexp); method ActionValue#(Floating_output#(fpinp)) _start(Bit#(fpinp) operand1,Bit#(fpinp) operand2, Bit#(3) which_cmp_instr,bit cmp_or_min_max,Tuple2#(Bit#(5),Bit#(5)) condFlags); endinterface `ifdef fpu_hierarchical interface Ifc_fpu_compare_min_max32; method ActionValue#(Floating_output#(32)) _start(Bit#(32) operand1,Bit#(32) operand2, Bit#(3) which_cmp_instr,bit cmp_or_min_max,Tuple2#(Bit#(5),Bit#(5)) condFlags); endinterface interface Ifc_fpu_compare_min_max64; method ActionValue#(Floating_output#(64)) _start(Bit#(64) operand1,Bit#(64) operand2, Bit#(3) which_cmp_instr,bit cmp_or_min_max,Tuple2#(Bit#(5),Bit#(5)) condFlags); endinterface `endif //(*noinline*) function Bit#(2) fn_comparator(bit sign1, Bit#(fpexp) exponent1, Bit#(fpman) mantissa1, bit sign2, Bit#(fpexp) exponent2, Bit#(fpman) mantissa2); Bit#(2) magnitude; //01 means inp2's magnitude is greater than inp1's magnitude //10 means inp1's magnitude is greater than inp2's magnitude //11 means inp2's magnitude is equal to inp1's magnitude if(exponent1