1 ; RUN: llc < %s -mtriple=ve | FileCheck %s
3 ;;; Test ‘fneg’ Instruction
6 ;;; <result> = fneg ptr <ty> <op1> ; yields ty:result
9 ;;; The ‘fneg’ instruction returns the negation of its operand.
12 ;;; The argument to the ‘fneg’ instruction must be a floating-point or
13 ;;; vector of floating-point values.
17 ;;; The value produced is a copy of the operand with its sign bit flipped.
18 ;;; This instruction can also take any number of fast-math flags, which are
19 ;;; optimization hints to enable otherwise unsafe floating-point
23 ;;; <result> = fneg float %val ; yields float:result = -%var
26 ;;; We test only float/double/fp128.
28 ; Function Attrs: norecurse nounwind readnone
29 define float @fneg_float(float %0) {
30 ; CHECK-LABEL: fneg_float:
32 ; CHECK-NEXT: sra.l %s0, %s0, 32
33 ; CHECK-NEXT: lea %s1, -2147483648
34 ; CHECK-NEXT: and %s1, %s1, (32)0
35 ; CHECK-NEXT: xor %s0, %s0, %s1
36 ; CHECK-NEXT: sll %s0, %s0, 32
37 ; CHECK-NEXT: b.l.t (, %s10)
42 ; Function Attrs: norecurse nounwind readnone
43 define double @fneg_double(double %0) {
44 ; CHECK-LABEL: fneg_double:
46 ; CHECK-NEXT: xor %s0, %s0, (1)1
47 ; CHECK-NEXT: b.l.t (, %s10)
52 ; Function Attrs: norecurse nounwind readnone
53 define fp128 @fneg_quad(fp128 %0) {
54 ; CHECK-LABEL: fneg_quad:
55 ; CHECK: .LBB{{[0-9]+}}_2:
56 ; CHECK-NEXT: st %s1, (, %s11)
57 ; CHECK-NEXT: st %s0, 8(, %s11)
58 ; CHECK-NEXT: ld1b.zx %s0, 15(, %s11)
59 ; CHECK-NEXT: lea %s1, 128
60 ; CHECK-NEXT: xor %s0, %s0, %s1
61 ; CHECK-NEXT: st1b %s0, 15(, %s11)
62 ; CHECK-NEXT: ld %s1, (, %s11)
63 ; CHECK-NEXT: ld %s0, 8(, %s11)
64 ; CHECK-NEXT: adds.l %s11, 16, %s11
65 ; CHECK-NEXT: b.l.t (, %s10)