File: double-extensions.ll

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 2,245,044 kB
  • sloc: cpp: 7,619,726; ansic: 1,434,018; asm: 1,058,748; python: 252,740; f90: 94,671; objc: 70,685; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,666; awk: 3,523; javascript: 2,409; xml: 892; fortran: 770
file content (53 lines) | stat: -rw-r--r-- 1,460 bytes parent folder | download | duplicates (3)
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
52
53
; RUN: opt -S --passes="print-dx-shader-flags" 2>&1 %s | FileCheck %s

target triple = "dxil-pc-shadermodel6.7-library"

; CHECK: ; Combined Shader Flags for Module
; CHECK-NEXT: ; Shader Flags Value: 0x00100044

; CHECK: ; Note: shader requires additional functionality:
; CHECK-NEXT: ;       Double-precision floating point
; CHECK-NEXT: ;       Double-precision extensions for 11.1
; CHECK-NEXT: ;       64-Bit integer
; CHECK-NEXT: ; Note: extra DXIL module flags:
; CHECK-NEXT: ;
; CHECK-NEXT: ; Shader Flags for Module Functions

;CHECK: ; Function top_level : 0x00100044
define double @top_level() #0 {
  %r = call double @test_uitofp_i64(i64 5)
  ret double %r
}


; CHECK: ; Function test_fdiv_double : 0x00000044
define double @test_fdiv_double(double %a, double %b) #0 {
  %res = fdiv double %a, %b
  ret double %res
}

; CHECK: ; Function test_uitofp_i64 : 0x00100044
define double @test_uitofp_i64(i64 %a) #0 {
  %r = uitofp i64 %a to double
  ret double %r
}

; CHECK: ; Function test_sitofp_i64 : 0x00100044
define double @test_sitofp_i64(i64 %a) #0 {
  %r = sitofp i64 %a to double
  ret double %r
}

; CHECK: ; Function test_fptoui_i32 : 0x00000044
define i32 @test_fptoui_i32(double %a) #0 {
  %r = fptoui double %a to i32
  ret i32 %r
}

; CHECK: ; Function test_fptosi_i64 : 0x00100044
define i64 @test_fptosi_i64(double %a) #0 {
  %r = fptosi double %a to i64
  ret i64 %r
}

attributes #0 = { convergent norecurse nounwind "hlsl.export"}