packages feed

clash-systemverilog-0.6.4: primitives/GHC.Base.json

[ { "Primitive" :
    { "name"      : "GHC.Base.$"
    , "primType"  : "Function"
    }
  }
, { "BlackBox" :
    { "name"      : "GHC.Base.quotInt"
    , "type"      : "quotInt :: Int -> Int -> Int"
    , "templateE" : "~ARG[0] / ~ARG[1]"
    }
  }
, { "BlackBox" :
    { "name"      : "GHC.Base.remInt"
    , "type"      : "remInt :: Int -> Int -> Int"
    , "templateE" : "~ARG[0] % ~ARG[1]"
    }
  }
, { "BlackBox" :
    { "name"      : "GHC.Base.divInt"
    , "type"      : "divInt :: Int -> Int -> Int"
    , "templateD" :
"// divInt begin
~SIGD[~SYM[0]][0];
~SIGD[~SYM[1]][0];
~SIGD[~SYM[2]][1];

// divide (rounds towards zero)
assign ~SYM[0] = ~ARG[0] / ~ARG[1];

// round toward minus infinity
assign ~SYM[1] = ~ARG[0];
assign ~SYM[2] = ~ARG[1];
assign ~RESULT = (~SYM[1][~SIZE[~TYPO]-1] == ~SYM[2][~SIZE[~TYPO]-1]) ? ~SYM[0] : ~SYM[0] - ~SIZE[~TYPO]'sd1;
// divInt end"
    }
  }
, { "BlackBox" :
    { "name"      : "GHC.Base.modInt"
    , "type"      : "modInt :: Int -> Int -> Int"
    , "templateD" :
"// modInt begin
~SIGD[~SYM[0]][0];
~SIGD[~SYM[1]][0];
~SIGD[~SYM[2]][1];

// remainder
assign ~SYM[0] = ~ARG[0] % ~ARG[1];

// modulo
assign ~SYM[1] = ~ARG[0];
assign ~SYM[2] = ~ARG[1];
assign ~RESULT = (~SYM[1][~SIZE[~TYPO]-1] == ~SYM[2][~SIZE[~TYPO]-1]) ?
                 ~SYM[0] :
                 ((~ARG[1] == ~SIZE[~TYPO]'sd0) ? ~SIZE[~TYPO]'sd0 : ~SYM[0] + ~ARG[1]);
// modInt end"
    }
  }
]