File: nan.ll

package info (click to toggle)
spirv-llvm-translator-21 21.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,612 kB
  • sloc: cpp: 47,807; ansic: 6,283; lisp: 3,878; sh: 162; python: 58; makefile: 41
file content (33 lines) | stat: -rw-r--r-- 1,048 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
; RUN: llvm-as %s -o %t.bc
; RUN: llvm-spirv %t.bc -o %t.spv
; RUN: llvm-spirv %t.spv -to-text -o %t.spt
; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV

; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefixes=CHECK-LLVM
; RUN: llvm-spirv -r %t.spv --spirv-target-env=SPV-IR -o %t.rev.bc
; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefixes=CHECK-SPV-IR

; Check OpenCL built-in nan translation.

target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64-G1"
target triple = "spir64"

; CHECK-SPIRV: ExtInst [[#]] [[#]] [[#]] nan

; CHECK-LLVM: call spir_func float @_Z3nanj(

; CHECK-SPV-IR: call spir_func float @_Z15__spirv_ocl_nanj(

define dso_local spir_kernel void @test(ptr addrspace(1) align 4 %a, i32 %b) {
entry:
  %call = tail call spir_func float @_Z3nanj(i32 %b)
  store float %call, ptr addrspace(1) %a, align 4
  ret void
}

declare spir_func float @_Z3nanj(i32)

!opencl.ocl.version = !{!0}

!0 = !{i32 3, i32 0}