aboutsummaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorJiahao Xu <xujiahao@loongson.cn>2023-12-06 15:04:52 +0800
committerLulu Cheng <chenglulu@loongson.cn>2023-12-08 16:29:50 +0800
commit9a07bc477e197ef935679bacd0a923a98c006b2a (patch)
tree2e483a41d7dfc256df3685982b90ac506dec424d /libgomp
parent276c7618bf41bc2f03cf4b22c24b23c8ba29eca4 (diff)
downloadgcc-9a07bc477e197ef935679bacd0a923a98c006b2a.zip
gcc-9a07bc477e197ef935679bacd0a923a98c006b2a.tar.gz
gcc-9a07bc477e197ef935679bacd0a923a98c006b2a.tar.bz2
LoongArch: New options -mrecip and -mrecip= with ffast-math.
When both the -mrecip and -mfrecipe options are enabled, use approximate reciprocal instructions and approximate reciprocal square root instructions with additional Newton-Raphson steps to implement single precision floating-point division, square root and reciprocal square root operations, for a better performance. gcc/ChangeLog: * config/loongarch/genopts/loongarch.opt.in (recip_mask): New variable. (-mrecip, -mrecip): New options. * config/loongarch/lasx.md (div<mode>3): New expander. (*div<mode>3): Rename. (sqrt<mode>2): New expander. (*sqrt<mode>2): Rename. (rsqrt<mode>2): New expander. * config/loongarch/loongarch-protos.h (loongarch_emit_swrsqrtsf): New prototype. (loongarch_emit_swdivsf): Ditto. * config/loongarch/loongarch.cc (loongarch_option_override_internal): Set recip_mask for -mrecip and -mrecip= options. (loongarch_emit_swrsqrtsf): New function. (loongarch_emit_swdivsf): Ditto. * config/loongarch/loongarch.h (RECIP_MASK_NONE, RECIP_MASK_DIV, RECIP_MASK_SQRT RECIP_MASK_RSQRT, RECIP_MASK_VEC_DIV, RECIP_MASK_VEC_SQRT, RECIP_MASK_VEC_RSQRT RECIP_MASK_ALL): New bitmasks. (TARGET_RECIP_DIV, TARGET_RECIP_SQRT, TARGET_RECIP_RSQRT, TARGET_RECIP_VEC_DIV TARGET_RECIP_VEC_SQRT, TARGET_RECIP_VEC_RSQRT): New tests. * config/loongarch/loongarch.md (sqrt<mode>2): New expander. (*sqrt<mode>2): Rename. (rsqrt<mode>2): New expander. * config/loongarch/loongarch.opt (recip_mask): New variable. (-mrecip, -mrecip): New options. * config/loongarch/lsx.md (div<mode>3): New expander. (*div<mode>3): Rename. (sqrt<mode>2): New expander. (*sqrt<mode>2): Rename. (rsqrt<mode>2): New expander. * config/loongarch/predicates.md (reg_or_vecotr_1_operand): New predicate. * doc/invoke.texi (LoongArch Options): Document new options. gcc/testsuite/ChangeLog: * gcc.target/loongarch/divf.c: New test. * gcc.target/loongarch/recip-divf.c: New test. * gcc.target/loongarch/recip-sqrtf.c: New test. * gcc.target/loongarch/sqrtf.c: New test. * gcc.target/loongarch/vector/lasx/lasx-divf.c: New test. * gcc.target/loongarch/vector/lasx/lasx-recip-divf.c: New test. * gcc.target/loongarch/vector/lasx/lasx-recip-sqrtf.c: New test. * gcc.target/loongarch/vector/lasx/lasx-recip.c: New test. * gcc.target/loongarch/vector/lasx/lasx-sqrtf.c: New test. * gcc.target/loongarch/vector/lsx/lsx-divf.c: New test. * gcc.target/loongarch/vector/lsx/lsx-recip-divf.c: New test. * gcc.target/loongarch/vector/lsx/lsx-recip-sqrtf.c: New test. * gcc.target/loongarch/vector/lsx/lsx-recip.c: New test. * gcc.target/loongarch/vector/lsx/lsx-sqrtf.c: New test.
Diffstat (limited to 'libgomp')
0 files changed, 0 insertions, 0 deletions