Skip to content

Add support for building Hwacha with reduced FP precision/no FDIV/no IDIV#29

Open
jerryz123 wants to merge 4 commits into
masterfrom
nodfma
Open

Add support for building Hwacha with reduced FP precision/no FDIV/no IDIV#29
jerryz123 wants to merge 4 commits into
masterfrom
nodfma

Conversation

@jerryz123

Copy link
Copy Markdown
Contributor

No description provided.

@jerryz123 jerryz123 requested review from a0u and colinschmidt March 14, 2021 03:38

@a0u a0u left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If unimplemented, the FMA instructions should be excluded from the decode tables so an illegal instruction assertion will be raised if used:

VFMADD_D ->(List[BitPat](Y,N,N,N,Y,RX,Y,Y,RX,Y,Y,RX,Y,Y,RX,Y,Y,IMM_X,FN_X, DW__,A1_X, A2_X, Y,FPD,N,VM_X,M_X, N,SM_X,MT_X, N,I_X, N, N,IM_X, N,ID_X, Y,FM_MADD, N,FD_X, N,FC_X, N,FV_X, N,N) ++ FMADD_D),
VFMSUB_D ->(List[BitPat](Y,N,N,N,Y,RX,Y,Y,RX,Y,Y,RX,Y,Y,RX,Y,Y,IMM_X,FN_X, DW__,A1_X, A2_X, Y,FPD,N,VM_X,M_X, N,SM_X,MT_X, N,I_X, N, N,IM_X, N,ID_X, Y,FM_MSUB, N,FD_X, N,FC_X, N,FV_X, N,N) ++ FMSUB_D),
VFNMADD_D ->(List[BitPat](Y,N,N,N,Y,RX,Y,Y,RX,Y,Y,RX,Y,Y,RX,Y,Y,IMM_X,FN_X, DW__,A1_X, A2_X, Y,FPD,N,VM_X,M_X, N,SM_X,MT_X, N,I_X, N, N,IM_X, N,ID_X, Y,FM_NMADD,N,FD_X, N,FC_X, N,FV_X, N,N) ++ FNMADD_D),
VFNMSUB_D ->(List[BitPat](Y,N,N,N,Y,RX,Y,Y,RX,Y,Y,RX,Y,Y,RX,Y,Y,IMM_X,FN_X, DW__,A1_X, A2_X, Y,FPD,N,VM_X,M_X, N,SM_X,MT_X, N,I_X, N, N,IM_X, N,ID_X, Y,FM_NMSUB,N,FD_X, N,FC_X, N,FV_X, N,N) ++ FNMSUB_D),
VFADD_D ->(List[BitPat](Y,N,N,N,Y,RX,Y,Y,RX,Y,Y,RX,Y,N,RX,N,Y,IMM_X,FN_X, DW__,A1_X, A2_X, Y,FPD,N,VM_X,M_X, N,SM_X,MT_X, N,I_X, N, N,IM_X, N,ID_X, Y,FM_ADD, N,FD_X, N,FC_X, N,FV_X, N,N) ++ FADD_D),
VFSUB_D ->(List[BitPat](Y,N,N,N,Y,RX,Y,Y,RX,Y,Y,RX,Y,N,RX,N,Y,IMM_X,FN_X, DW__,A1_X, A2_X, Y,FPD,N,VM_X,M_X, N,SM_X,MT_X, N,I_X, N, N,IM_X, N,ID_X, Y,FM_SUB, N,FD_X, N,FC_X, N,FV_X, N,N) ++ FSUB_D),
VFMUL_D ->(List[BitPat](Y,N,N,N,Y,RX,Y,Y,RX,Y,Y,RX,Y,N,RX,N,Y,IMM_X,FN_X, DW__,A1_X, A2_X, Y,FPD,N,VM_X,M_X, N,SM_X,MT_X, N,I_X, N, N,IM_X, N,ID_X, Y,FM_MUL, N,FD_X, N,FC_X, N,FV_X, N,N) ++ FMUL_D),

This should also apply to single and half precision for consistency.

Comment thread src/main/scala/vfu-fma.scala
@colinschmidt

Copy link
Copy Markdown
Contributor

I would suggest making all double precision operations illegal (the strange subset that exists when only DFMA is removed is unlikely to be useful) and then I would consider looking at all the other double precision functional units included (FDIV, FCMP, FCOMP) to see how much more area/power you could save.

@jerryz123

Copy link
Copy Markdown
Contributor Author

I've revised the PR to more thoroughly remove unused FP units, and explicitly throw illegal instruction exceptions for unsupported types.

@jerryz123 jerryz123 changed the title Add support for building Hwacha with no DFMAs Add support for building Hwacha with reduced FP precision/no FDIV/no IDIV Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants