angr.analyses.decompiler.known_patterns.libm_bits¶
libm floating-point bit-twiddling idioms (fabs / -x / copysign / isnan / isinf).
Every one of these “functions” is a compiler intrinsic: on x86-64 with SSE they
become a single andpd / xorpd / andnpd / ucomisd against a
sign-mask constant kept in .rodata. angr’s constant_derefs peephole
folds the rip-relative mask load into a Const, so what reaches the AIL is a
plain integer bit operation on the raw float bits: fabs(x) is
x & 0x7fffffffffffffff, unreadable unless it is named again.
Two AIL spellings show up for the SSE operand, depending on whether the 128-bit vector op survived narrowing:
narrowed:
BinaryOp(And, vvar_0, 0x7fffffffffffffff<64>)unnarrowed:
BinaryOp(Xor, Conv(64->128, vvar_0), 0x8000000000000000<128>)under anExtract(..., 64bits@0)
_sse_operand accepts both and always captures the underlying vvar, which
the Outliner requires (call parameters must bind VirtualVariables).
Intel-SSE specific (the mask widths are fixed by the FP format, not by the pointer size), so these are not word-scaled. Calibrated against tests/x86_64/decompiler/known_patterns_libm_bits (gcc -O2 -fno-tree-vectorize).