69 lines · plain
1; RUN: llc < %s -mtriple=ve | FileCheck %s2 3;;; Test ‘fneg’ Instruction4;;;5;;; Syntax:6;;; <result> = fneg ptr <ty> <op1> ; yields ty:result7;;;8;;; Overview:9;;; The ‘fneg’ instruction returns the negation of its operand.10;;;11;;; Arguments:12;;; The argument to the ‘fneg’ instruction must be a floating-point or13;;; vector of floating-point values.14;;;15;;; Semantics:16;;;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 are19;;; optimization hints to enable otherwise unsafe floating-point20;;; optimizations.21;;;22;;; Example:23;;; <result> = fneg float %val ; yields float:result = -%var24;;;25;;; Note:26;;; We test only float/double/fp128.27 28; Function Attrs: norecurse nounwind readnone29define float @fneg_float(float %0) {30; CHECK-LABEL: fneg_float:31; CHECK: # %bb.0:32; CHECK-NEXT: sra.l %s0, %s0, 3233; CHECK-NEXT: lea %s1, -214748364834; CHECK-NEXT: and %s1, %s1, (32)035; CHECK-NEXT: xor %s0, %s0, %s136; CHECK-NEXT: sll %s0, %s0, 3237; CHECK-NEXT: b.l.t (, %s10)38 %2 = fneg float %039 ret float %240}41 42; Function Attrs: norecurse nounwind readnone43define double @fneg_double(double %0) {44; CHECK-LABEL: fneg_double:45; CHECK: # %bb.0:46; CHECK-NEXT: xor %s0, %s0, (1)147; CHECK-NEXT: b.l.t (, %s10)48 %2 = fneg double %049 ret double %250}51 52; Function Attrs: norecurse nounwind readnone53define 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, 12860; CHECK-NEXT: xor %s0, %s0, %s161; 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, %s1165; CHECK-NEXT: b.l.t (, %s10)66 %2 = fneg fp128 %067 ret fp128 %268}69