From: Luke Kenneth Casson Leighton Date: Mon, 12 Aug 2019 02:38:12 +0000 (+0100) Subject: rework table X-Git-Tag: convert-csv-opcode-to-binary~4235 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bc5f548e32d25cd15bd27ff8f32367df0b7ce2c1;p=libreriscv.git rework table --- diff --git a/ztrans_proposal.mdwn b/ztrans_proposal.mdwn index a854550be..ba3f66504 100644 --- a/ztrans_proposal.mdwn +++ b/ztrans_proposal.mdwn @@ -39,6 +39,63 @@ Zarctrignpi * Reciprocal Square-root is in its own separate extension (Zfrsqrt) as it is desirable on its own by other implementors. This to be evaluated. +# Proposed Opcodes vs Khronos OpenCL Opcodes + +This list shows the (direct) equivalence between proposed opcodes and +their Khronos OpenCL equivalents. + +See + + +Special FP16 opcodes are *not* being proposed, except by indirect / inherent +use of the "fmt" field that is already present in the RISC-V Specification. + +"Native" opcodes are *not* being proposed: implementors will be expected +to use the (equivalent) proposed opcode covering the same function. + +"Fast" opcodes are *not* being proposed, because the Khronos Specification +fast\_length, fast\_normalise and fast\_distance OpenCL opcodes require +vectors (or can be done as scalar operations using other RISC-V instructions). + +The OpenCL FP32 opcodes are **direct** equivalents to the proposed opcodes. +Deviation from conformance with the Khronos Specification - including the +Khronos Specification accuracy requirements - is not an option. + +[[!table data=""" +Proposed opcode | OpenCL FP32 | OpenCL FP16 | OpenCL native | OpenCL fast | +FSIN | sin | half\_sin | native\_sin | NONE | +FCOS | cos | half\_cos | native\_cos | NONE | +FTAN | tan | half\_tan | native\_tan | NONE | +FASIN | asin | NONE | NONE | NONE | +FACOS | acos | NONE | NONE | NONE | +FSINPI | sinpi | NONE | NONE | NONE | +FCOSPI | cospi | NONE | NONE | NONE | +FTANPI | tanpi | NONE | NONE | NONE | +FASINPI | asinpi | NONE | NONE | NONE | +FACOSPI | acospi | NONE | NONE | NONE | +FATANPI | atanpi | NONE | NONE | NONE | +FSINH | sinh | NONE | NONE | NONE | +FCOSH | cosh | NONE | NONE | NONE | +FTANH | tanh | NONE | NONE | NONE | +FASINH | asinh | NONE | NONE | NONE | +FACOSH | acosh | NONE | NONE | NONE | +FATANH | atanh | NONE | NONE | NONE | +FRSQRT | rsqrt | half\_rsqrt | native\_rsqrt | NONE | +FCBRT | cbrt | NONE | NONE | NONE | +FEXP2 | exp2 | half\_exp2 | native\_exp2 | NONE | +FLOG2 | log2 | half\_log2 | native\_log2 | NONE | +FEXPM1 | expm1 | NONE | NONE | NONE | +FLOG1P | log1p | NONE | NONE | NONE | +FEXP | exp | half\_exp | native\_exp | NONE | +FLOG | log | half\_log | native\_log | NONE | +FEXP10 | exp10 | half\_exp10 | native\_exp10 | NONE | +FLOG10 | log10 | half\_log10 | native\_log10 | NONE | +FATAN2 | atan2 | NONE | NONE | NONE | +FATAN2PI | atan2pi | NONE | NONE | NONE | +FPOW | pow | NONE | NONE | NONE | +FROOT | rootn | NONE | NONE | NONE | +FHYPOT | hypot | NONE | NONE | NONE | +"""]] # List of 2-arg opcodes @@ -90,44 +147,6 @@ FACOSH | inverse hyperbolic cos | rd = acosh(rs1) | Zfhyp | FATANH | inverse hyperbolic tan | rd = atanh(rs1) | Zfhyp | """]] -# List of Our Proposed Functions vs Khronos OpenCL Functions - -[[!table data=""" -Our proposed opcode | OpenCL FP32 | OpenCL FP16 | OpenCL native | OpenCL fast | -FSIN | sin | half_sin | native_sin | NONE | -FCOS | cos | half_cos | native_cos | NONE | -FTAN | tan | half_tan | native_tan | NONE | -FASIN | asin | NONE | NONE | NONE | -FACOS | acos | NONE | NONE | NONE | -FSINPI | sinpi | NONE | NONE | NONE | -FCOSPI | cospi | NONE | NONE | NONE | -FTANPI | tanpi | NONE | NONE | NONE | -FASINPI | asinpi | NONE | NONE | NONE | -FACOSPI | acospi | NONE | NONE | NONE | -FATANPI | atanpi | NONE | NONE | NONE | -FSINH | sinh | NONE | NONE | NONE | -FCOSH | cosh | NONE | NONE | NONE | -FTANH | tanh | NONE | NONE | NONE | -FASINH | asinh | NONE | NONE | NONE | -FACOSH | acosh | NONE | NONE | NONE | -FATANH | atanh | NONE | NONE | NONE | -FRSQRT | rsqrt | half_rsqrt | native_rsqrt | NONE | -FCBRT | cbrt | NONE | NONE | NONE | -FEXP2 | exp2 | half_exp2 | native_exp2 | NONE | -FLOG2 | log2 | half_log2 | native_log2 | NONE | -FEXPM1 | expm1 | NONE | NONE | NONE | -FLOG1P | log1p | NONE | NONE | NONE | -FEXP | exp | half_exp | native_exp | NONE | -FLOG | log | half_log | native_log | NONE | -FEXP10 | exp10 | half_exp10 | native_exp10 | NONE | -FLOG10 | log10 | half_log10 | native_log10 | NONE | -FATAN2 | atan2 | NONE | NONE | NONE | -FATAN2PI | atan2pi | NONE | NONE | NONE | -FPOW | pow | NONE | NONE | NONE | -FROOT | rootn | NONE | NONE | NONE | -FHYPOT | hypot | NONE | NONE | NONE | -"""]] - # Synthesis, Pseudo-code ops and macro-ops The pseudo-ops are best left up to the compiler rather than being actual