Home | History | Annotate | Download | only in PowerPC
      1 ; RUN: llc -mcpu=pwr7 -O1 -code-model=medium -mattr=-vsx < %s | FileCheck %s
      2 ; RUN: llc -mcpu=pwr7 -O1 -code-model=medium -mattr=+vsx < %s | FileCheck -check-prefix=CHECK-VSX %s
      3 
      4 ; Test peephole optimization for medium code model (32-bit TOC offsets)
      5 ; for loading a value from the constant pool (TOC-relative).
      6 
      7 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
      8 target triple = "powerpc64-unknown-linux-gnu"
      9 
     10 define double @test_double_const() nounwind {
     11 entry:
     12   ret double 0x3F4FD4920B498CF0
     13 }
     14 
     15 ; CHECK: [[VAR:[a-z0-9A-Z_.]+]]:
     16 ; CHECK: .quad 4562098671269285104
     17 ; CHECK-LABEL: test_double_const:
     18 ; CHECK: addis [[REG1:[0-9]+]], 2, [[VAR]]@toc@ha
     19 ; CHECK: lfd {{[0-9]+}}, [[VAR]]@toc@l([[REG1]])
     20 
     21 ; CHECK-VSX: [[VAR:[a-z0-9A-Z_.]+]]:
     22 ; CHECK-VSX: .quad 4562098671269285104
     23 ; CHECK-VSX-LABEL: test_double_const:
     24 ; CHECK-VSX: addis [[REG1:[0-9]+]], 2, [[VAR]]@toc@ha
     25 ; CHECK-VSX: addi [[REG1]], {{[0-9]+}}, [[VAR]]@toc@l
     26 ; CHECK-VSX: lxsdx {{[0-9]+}}, 0, [[REG1]]
     27