The generic compile rules currently rely on the compiler to infer
object and depfile names from the source pathname when -o and -MF
are not passed explicitly.
That works for plain compiler invocations. However, older ccache
versions with CCACHE_BASEDIR can rewrite a symlinked source path to
its target path before deriving the default output names. In that
case, compiling spike_dasm_option_parser.cc may create
option_parser.o and option_parser.d instead of the declared target
filenames, which breaks the build.
Upstream ccache fixed this in v4.12, but older versions remain
common in distribution and CI environments. Pass explicit -o $@ and
matching -MF paths in the generic C, C++, test, program,
install-program, and precompiled-header rules.
This keeps each recipe output aligned with the declared make target
and avoids depending on inferred filenames.
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Replace bare __int128 / unsigned __int128 in psshar_dhs.h and psshar_dws.h
with the int128_t / uint128_t typedefs from fesvr/byteorder.h, and guard
the entire riscv_insn_ext_p list in riscv.mk.in with $(if $(HAVE_INT128),...)
matching the existing pattern for the V extension
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Per the P-extension spec, any instruction that performs saturation must
set the vxsat CSR to 1 when the result is clamped. 70 instructions were
missing this write, addressed here in two ways:
1. Convert P_SAT, P_USAT, and P_USAT_FULL macros from pure expression
macros to GCC statement expressions that detect when saturation
occurs and write P.VU.vxsat. This automatically fixes ~42
instructions that use these macros (nclip/nclipi/nclipr/nclipri
families, psati, psslai, pssh1sadd, pusati, sati, usati, ssh1sadd,
sslai, and their packed/double-wide variants).
2. Add explicit vxsat writes to 22 instructions with inline saturation
logic that bypasses the macros:
- mulq/mulqr/pmulq/pmulqr: set vxsat on INT_MIN * INT_MIN overflow
- psas/pssa cross variants: set vxsat from sat_add/sat_sub sat flag
- pssha/psshar DW variants: set vxsat from ov overflow flag
- pssha/psshar/ssha/sshar: set vxsat in sshamt >= BIT overflow path
- pusati_dh/pusati_dw: set vxsat on unsigned range clamping
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Bulk normalized dot product is expected to raise the invalid flag if two products with infinite values and opposite signs are added.
Spike function failed to consider the second operand of a product when determining whether the product had infinite value or not, and missed the exclusion of NaN and zero from this case.
The zero case is quiet, because it happens for inf * zero which is expected to raise the invalid flag. The qNaN case is not quiet and can cause the apparition of a spurious invalid flag when none were expected.