File: fcmp32.ll

package info (click to toggle)
llvm-3.1 3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 80,224 kB
  • sloc: cpp: 491,014; asm: 110,971; ansic: 14,579; sh: 13,120; python: 6,152; ml: 4,719; makefile: 1,830; pascal: 1,553; perl: 874; xml: 283; lisp: 187; csh: 117; exp: 4
file content (36 lines) | stat: -rw-r--r-- 771 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
; RUN: llc --march=cellspu %s -o - | FileCheck %s

; Exercise the floating point comparison operators for f32:

declare double @fabs(double)
declare float @fabsf(float)

define i1 @fcmp_eq(float %arg1, float %arg2) {
; CHECK: fceq
; CHECK: bi $lr
        %A = fcmp oeq float %arg1,  %arg2
        ret i1 %A
}

define i1 @fcmp_mag_eq(float %arg1, float %arg2) {
; CHECK: fcmeq
; CHECK: bi $lr
        %1 = call float @fabsf(float %arg1)
        %2 = call float @fabsf(float %arg2)
        %3 = fcmp oeq float %1, %2
        ret i1 %3
}

define i1 @test_ogt(float %a, float %b) {
; CHECK: fcgt
; CHECK: bi $lr
	%cmp = fcmp ogt float %a, %b
	ret i1 %cmp
}

define i1 @test_ugt(float %a, float %b) {
; CHECK: fcgt
; CHECK: bi $lr
	%cmp = fcmp ugt float %a, %b
	ret i1 %cmp
}