File: asm-op-interface.mlir

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (44 lines) | stat: -rw-r--r-- 991 bytes parent folder | download | duplicates (14)
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
// RUN: mlir-opt %s -split-input-file | FileCheck %s

func.func @const() -> () {
  // CHECK: %true
  %0 = spirv.Constant true
  // CHECK: %false
  %1 = spirv.Constant false

  // CHECK: %cst42_i32
  %2 = spirv.Constant 42 : i32
  // CHECK: %cst-42_i32
  %-2 = spirv.Constant -42 : i32
  // CHECK: %cst43_i64
  %3 = spirv.Constant 43 : i64

  // CHECK-NEXT: %cst6_ui8
  %9 = spirv.Constant 6 : ui8  

  // CHECK: %cst_f32
  %4 = spirv.Constant 0.5 : f32
  // CHECK: %cst_f64
  %5 = spirv.Constant 0.5 : f64

  // CHECK: %cst_vec_3xi32
  %6 = spirv.Constant dense<[1, 2, 3]> : vector<3xi32>

  // CHECK: %cst
  %8 = spirv.Constant [dense<3.0> : vector<2xf32>] : !spirv.array<1xvector<2xf32>>

  return
}

// -----

spirv.module Logical GLSL450 {
  spirv.GlobalVariable @global_var : !spirv.ptr<f32, Input>

  spirv.func @addressof() -> () "None" {
    // CHECK: %global_var_addr = spirv.mlir.addressof
    %0 = spirv.mlir.addressof @global_var : !spirv.ptr<f32, Input>
    spirv.Return
  }
}