From 6c3e71dd8262020911376597d768018857112628 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Thu, 13 Feb 2025 18:59:49 +0000 Subject: [PATCH] #14604: Optimize Blackhole muladd negation --- binutils | 2 +- gcc | 2 +- include/blackhole/sfpi_imp.h | 5 ++--- include/grayskull/sfpi_imp.h | 5 ++--- include/sfpi.h | 3 +-- include/wormhole/sfpi_imp.h | 5 ++--- 6 files changed, 9 insertions(+), 13 deletions(-) diff --git a/binutils b/binutils index 454d1fb..52e1bb2 160000 --- a/binutils +++ b/binutils @@ -1 +1 @@ -Subproject commit 454d1fb726225c2f32306e8947ece0d0c06a9cbe +Subproject commit 52e1bb2b633317a94a2d18a19d8c16f9ff331ddf diff --git a/gcc b/gcc index 331798e..7b8e5d3 160000 --- a/gcc +++ b/gcc @@ -1 +1 @@ -Subproject commit 331798eb0671867a8ed40af68a891f107e9d3462 +Subproject commit 7b8e5d35f1527be7ceff82003359693ca72db643 diff --git a/include/blackhole/sfpi_imp.h b/include/blackhole/sfpi_imp.h index c80057b..6e6ba6e 100644 --- a/include/blackhole/sfpi_imp.h +++ b/include/blackhole/sfpi_imp.h @@ -89,9 +89,8 @@ sfpi_inline __vCond vFloat::operator>=(const float x) const { return __vCond(__v sfpi_inline vFloat vFloat::operator-=(const vFloat a) { - __rvtt_vec_t neg1 = __builtin_rvtt_sfpassignlreg(vConstNeg1.get()); - assign(__builtin_rvtt_sfpmad(neg1, a.get(), v, SFPMAD_MOD1_OFFSET_NONE)); - return v; + *this += -a; + return *this; } sfpi_inline vFloat::vFloat(const __vDReg dreg) diff --git a/include/grayskull/sfpi_imp.h b/include/grayskull/sfpi_imp.h index 69c3728..3da1f80 100644 --- a/include/grayskull/sfpi_imp.h +++ b/include/grayskull/sfpi_imp.h @@ -90,9 +90,8 @@ sfpi_inline __vCond vFloat::operator>=(const float x) const { return __vCond(__v sfpi_inline vFloat vFloat::operator-=(const vFloat a) { - __rvtt_vec_t neg1 = __builtin_rvtt_sfpassignlreg(vConstNeg1.get()); - assign(__builtin_rvtt_sfpmad(neg1, a.get(), v, SFPMAD_MOD1_OFFSET_NONE)); - return v; + *this += -a; + return *this; } sfpi_inline vFloat::vFloat(const __vDReg dreg) diff --git a/include/sfpi.h b/include/sfpi.h index 4d57f5a..cbb55be 100644 --- a/include/sfpi.h +++ b/include/sfpi.h @@ -759,8 +759,7 @@ sfpi_inline vFloat fp_mul(const vFloat a, const vFloat b) sfpi_inline vFloat fp_sub(const vFloat a, const vFloat b) { - __rvtt_vec_t neg1 = __builtin_rvtt_sfpassignlreg(vConstNeg1.get()); - return __builtin_rvtt_sfpmad(neg1, b.get(), a.get(), 0); + return a + -b; } } diff --git a/include/wormhole/sfpi_imp.h b/include/wormhole/sfpi_imp.h index c80057b..6e6ba6e 100644 --- a/include/wormhole/sfpi_imp.h +++ b/include/wormhole/sfpi_imp.h @@ -89,9 +89,8 @@ sfpi_inline __vCond vFloat::operator>=(const float x) const { return __vCond(__v sfpi_inline vFloat vFloat::operator-=(const vFloat a) { - __rvtt_vec_t neg1 = __builtin_rvtt_sfpassignlreg(vConstNeg1.get()); - assign(__builtin_rvtt_sfpmad(neg1, a.get(), v, SFPMAD_MOD1_OFFSET_NONE)); - return v; + *this += -a; + return *this; } sfpi_inline vFloat::vFloat(const __vDReg dreg)