在 2025/12/18 下午3:13, WANG Xuerui 写道:
From: WANG Xuerui <[email protected]>
This helps writing portable code that needs to work across LA32R and
LA32S. The tests only work with the fix for PR123171 applied.
gcc/ChangeLog:
* config/loongarch/loongarch-c.cc (loongarch_update_cpp_builtins):
Define __loongarch_non_reduced iff the current base ISA is not
LA32R.
Hi,
We still need to discuss the builtin-in macro in this regard. So we
won't mergee this patch for now.
gcc/testsuite/ChangeLog:
* gcc.target/loongarch/non-reduced-macro-1.c: New test.
* gcc.target/loongarch/non-reduced-macro-2.c: New test.
* gcc.target/loongarch/non-reduced-macro-3.c: New test.
Signed-off-by: WANG Xuerui <[email protected]>
---
/* snip */
+ loongarch_def_or_undef (la_target.isa.base != ISA_BASE_LA32R,
+ "__loongarch_non_reduced", pfile);
+
I think 'la_target.isa.base != ISA_BASE_LA32R' can be replaced with
'!TARGET_32BIT_R'.