Move Z sign swapping out of unpacker

This commit is contained in:
David Harris 2021-07-22 14:32:38 -04:00
parent 31be570461
commit c9890afb7f
2 changed files with 2 additions and 4 deletions

View File

@ -253,7 +253,7 @@ module fma2(
// Negate Z when doing one of the following opperations:
// -prod + Z
// prod - Z
assign ZSgnEffM = ZSgnM^FOpCtrlE[0]; // Swap sign of Z for subtract
assign ZSgnEffM = ZSgnM^FOpCtrlM[0]; // Swap sign of Z for subtract
assign InvZ = ZSgnEffM ^ PSgn;
// Choose an inverted or non-inverted addend - the one is added later

View File

@ -19,13 +19,11 @@ module unpacking (
logic XExpNonzero, YExpNonzero, ZExpNonzero;
logic XFracZero, YFracZero, ZFracZero; // input fraction zero
logic XExpZero, YExpZero, ZExpZero; // input exponent zero
// logic [63:0] Addend; // value to add (Z or zero)
logic YExpMaxE, ZExpMaxE; // input exponent all 1s
// assign Addend = FOpCtrlE[2] ? 64'b0 : Z; // Z is only used in the FMA, and is set to Zero if a multiply opperation
assign XSgnE = FmtE ? X[63] : X[31];
assign YSgnE = FmtE ? Y[63] : Y[31];
assign ZSgnE = FmtE ? Z[63]^FOpCtrlE[0] : Z[31]^FOpCtrlE[0]; // *** Maybe this should be done in the FMA for modularity?
assign ZSgnE = FmtE ? Z[63] : Z[31];
assign XExpE = FmtE ? X[62:52] : {X[30], {3{~X[30]&~XExpZero|XExpMaxE}}, X[29:23]};
assign YExpE = FmtE ? Y[62:52] : {Y[30], {3{~Y[30]&~YExpZero|YExpMaxE}}, Y[29:23]};