1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/lib
Matthias Braun f78978fb25 LegalizeDAG: Fix and improve FCOPYSIGN/FABS legalization
- Factor out code to query and modify the sign bit of a floatingpoint
  value as an integer. This also works if none of the targets integer
  types is big enough to hold all bits of the floatingpoint value.

- Legalize FABS(x) as FCOPYSIGN(x, 0.0) if FCOPYSIGN is available,
  otherwise perform bit manipulation on the sign bit. The previous code
  used "x >u 0 ? x : -x" which is incorrect for x being -0.0! It also
  takes 34 instructions on ARM Cortex-M4. With this patch we only
  require 5:
    vldr d0, LCPI0_0
    vmov r2, r3, d0
    lsrs r2, r3, #31
    bfi r1, r2, #31, #1
    bx lr
  (This could be further improved if the compiler would recognize that
   r2, r3 is zero).

- Only lower FCOPYSIGN(x, y) = sign(x) ? -FABS(x) : FABS(x) if FABS is
  available otherwise perform bit manipulation on the sign bit.

- Perform the sign(x) test by masking out the sign bit and comparing
  with 0 rather than shifting the sign bit to the highest position and
  testing for "<s 0". For x86 copysignl (on 80bit values) this gets us:
    testl $32768, %eax
  rather than:
    shlq $48, %rax
    sets %al
    testb %al, %al

Differential Revision: http://reviews.llvm.org/D11172

llvm-svn: 252839
2015-11-12 01:02:47 +00:00
..
Analysis [ValueTracking] Remove untested / unreachable code, NFC 2015-11-11 00:16:41 +00:00
AsmParser [IR] Add support for empty tokens 2015-11-11 21:57:16 +00:00
Bitcode [OperandBundles] Identify operand bundles with both their names and IDs 2015-11-10 20:13:15 +00:00
CodeGen LegalizeDAG: Fix and improve FCOPYSIGN/FABS legalization 2015-11-12 01:02:47 +00:00
DebugInfo [Symbolizer]: Add -pretty-print option 2015-11-11 20:41:43 +00:00
ExecutionEngine [RuntimeDyld] Add support for R_X86_64_PC8 relocation. 2015-11-08 19:34:17 +00:00
Fuzzer [libFuzzer] experimental flag -drill (another search heuristic; Mike Aizatsky's idea) 2015-11-12 01:02:01 +00:00
IR [IR] Add support for empty tokens 2015-11-11 21:57:16 +00:00
IRReader
LibDriver [Option] Use an ArrayRef to store the Option Infos in OptTable. NFC 2015-10-21 16:30:42 +00:00
LineEditor
Linker Ensure ModuleLinker materializes complete comdat groups 2015-11-10 21:09:06 +00:00
LTO Add a libLTO diagnostic handler that supports lto_get_error_message API 2015-11-11 19:59:08 +00:00
MC [MC] Use LShr for constant evaluation of ">>" on non-arm64 darwin. 2015-11-11 00:51:36 +00:00
Object Fix llvm-nm(1) printing of llvm-bitcode files for -format darwin to match darwin’s nm(1). 2015-11-10 00:31:08 +00:00
Option [Option] Use an ArrayRef to store the Option Infos in OptTable. NFC 2015-10-21 16:30:42 +00:00
Passes [PM] Port StripDeadPrototypes to the new pass manager 2015-10-30 23:28:12 +00:00
ProfileData Fix problems in coding style 2015-11-12 00:32:17 +00:00
Support Report Windows error code in a fatal error after a system call. 2015-11-11 20:49:32 +00:00
TableGen [TblGen] ArrayRefize TGParser. No functional change intended. 2015-10-24 12:46:45 +00:00
Target [TLS on Darwin] use a different mask for tls calls on x86-64. 2015-11-12 00:54:04 +00:00
Transforms [LIR] General refactor to improve compile-time and simplify code. 2015-11-11 23:00:59 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile