File: fabs.ll

package info (click to toggle)
intel-graphics-compiler 1.0.17791.18-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 102,312 kB
  • sloc: cpp: 935,343; lisp: 286,143; ansic: 16,196; python: 3,279; yacc: 2,487; lex: 1,642; pascal: 300; sh: 174; makefile: 27
file content (51 lines) | stat: -rw-r--r-- 2,019 bytes parent folder | download
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
;=========================== begin_copyright_notice ============================
;
; Copyright (C) 2024 Intel Corporation
;
; SPDX-License-Identifier: MIT
;
;============================ end_copyright_notice =============================

; RUN: %opt %use_old_pass_manager% -GenXLowering -march=genx64 -mcpu=Gen9 -mtriple=spir64-unknown-unknown -S < %s | FileCheck %s

declare float @llvm.fabs.f32(float) #1
declare <4 x float> @llvm.fabs.v4f32(<4 x float>) #1
declare double @llvm.fabs.f64(double) #1
declare <4 x double> @llvm.fabs.v4f64(<4 x double>) #1
attributes #1 = { nounwind readnone speculatable willreturn }

define spir_func float @scalar1(float %src) {
  %res = tail call float @llvm.fabs.f32(float %src)
  ret float %res
}
; CHECK-LABEL: define spir_func float @scalar1
; CHECK-SAME: (float %[[ARG1:[^ )]+]])
; CHECK: %[[RES1:[^ ]+]] = tail call float @llvm.fabs.f32(float %[[ARG1]])
; CHECK-NEXT: ret float %[[RES1]]

define spir_func double @scalar2(double %src) {
  %res = tail call double @llvm.fabs.f64(double %src)
  ret double %res
}
; CHECK-LABEL: define spir_func double @scalar2
; CHECK-SAME: (double %[[ARG3:[^ )]+]])
; CHECK: %[[RES3:[^ ]+]] = tail call double @llvm.fabs.f64(double %[[ARG3]])
; CHECK-NEXT: ret double %[[RES3]]

define spir_func <4 x float> @vector1(<4 x float> %src) {
  %res = tail call <4 x float> @llvm.fabs.v4f32(<4 x float> %src)
  ret <4 x float> %res
}
; CHECK-LABEL: define spir_func <4 x float> @vector1
; CHECK-SAME: (<4 x float> %[[ARG2:[^ )]+]])
; CHECK: %[[RES2:[^ ]+]] = tail call <4 x float> @llvm.fabs.v4f32(<4 x float> %[[ARG2]])
; CHECK-NEXT: ret <4 x float> %[[RES2]]

define spir_func <4 x double> @vector2(<4 x double> %src) {
  %res = tail call <4 x double> @llvm.fabs.v4f64(<4 x double> %src)
  ret <4 x double> %res
}
; CHECK-LABEL: define spir_func <4 x double> @vector2
; CHECK-SAME: (<4 x double> %[[ARG4:[^ )]+]])
; CHECK: %[[RES4:[^ ]+]] = tail call <4 x double> @llvm.fabs.v4f64(<4 x double> %[[ARG4]])
; CHECK-NEXT: ret <4 x double> %[[RES4]]