aboutsummaryrefslogtreecommitdiff
path: root/libphobos/src/std/algorithm
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2024-09-06 00:34:55 +0800
committerXi Ruoyao <xry111@xry111.site>2025-01-18 10:17:03 +0800
commitce36692f8e10a619563938851f507cdb15567cf8 (patch)
treea5da9e696bb1253f1643157fd49263f112b5146c /libphobos/src/std/algorithm
parentcc6176a921cbe3b9db323b1cd557efe4f299171a (diff)
downloadgcc-ce36692f8e10a619563938851f507cdb15567cf8.zip
gcc-ce36692f8e10a619563938851f507cdb15567cf8.tar.gz
gcc-ce36692f8e10a619563938851f507cdb15567cf8.tar.bz2
LoongArch: Fix cost model for alsl
Our cost model for alsl was wrong: it matches (a + b * imm) where imm is 1, 2, 3, or 4 (should be 2, 4, 8, or 16), and it does not match (a + (b << imm)) at all. For the test case: a += c << 3; b += c << 3; it caused the compiler to perform a CSE and make one slli and two add, but we just want two alsl. Also add a "code == PLUS" check to prevent matching a - (b << imm) as we don't have any "slsl" instruction. gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_rtx_costs): Fix the cost for (a + b * imm) and (a + (b << imm)) which can be implemented with a single alsl instruction. gcc/testsuite/ChangeLog: * gcc.target/loongarch/alsl-cost.c: New test.
Diffstat (limited to 'libphobos/src/std/algorithm')
0 files changed, 0 insertions, 0 deletions