diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2025-01-23 12:59:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-23 12:59:59 +0000 |
commit | 90e9895a9373b3d83eefe15b34d2dc83c7bcc88f (patch) | |
tree | 0c5762d60f0ecac3e29ee58b3f2483916d706ad1 /llvm/lib/FileCheck/FileCheck.cpp | |
parent | 0e944a30954e666cba2bf17497fafe835e4b3519 (diff) | |
download | llvm-90e9895a9373b3d83eefe15b34d2dc83c7bcc88f.zip llvm-90e9895a9373b3d83eefe15b34d2dc83c7bcc88f.tar.gz llvm-90e9895a9373b3d83eefe15b34d2dc83c7bcc88f.tar.bz2 |
[X86] Handle BSF/BSR "zero-input pass through" behaviour (#123623)
Intel docs have been updated to be similar to AMD and now describe
BSF/BSR as not changing the destination register if the input value was
zero, which allows us to support CTTZ/CTLZ zero-input cases by setting
the destination to support a NumBits result (BSR is a bit messy as it
has to be XOR'd to create a CTLZ result). VIA/Zhaoxin x86_64 CPUs have also
been confirmed to match this behaviour.
This patch adjusts the X86ISD::BSF/BSR nodes to take a "pass through"
argument for zero-input cases, by default this is set to UNDEF to match
existing behaviour, but it can be set to a suitable value if supported.
There are still some limits to this - its only supported for x86_64
capable processors (and I've only enabled it for x86_64 codegen), and
Intel CPUs sometimes zero the upper 32-bits of a pass through register
when used for BSR32/BSF32 with a zero source value (i.e. the whole
64bits may not get passed through).
Fixes #122004
Diffstat (limited to 'llvm/lib/FileCheck/FileCheck.cpp')
0 files changed, 0 insertions, 0 deletions