primitives.uir 5.58 KB
Newer Older
Kunshan Wang's avatar
Kunshan Wang committed
1 2 3 4 5 6 7 8 9
.typedef @i1        = int<1>
.typedef @i6        = int<6>
.typedef @i8        = int<8>
.typedef @i16       = int<16>
.typedef @i32       = int<32>
.typedef @i52       = int<52>
.typedef @i64       = int<64>
.typedef @float     = float
.typedef @double    = double
Kunshan Wang's avatar
Kunshan Wang committed
10

Kunshan Wang's avatar
Kunshan Wang committed
11
.typedef @void      = void
Kunshan Wang's avatar
Kunshan Wang committed
12

Kunshan Wang's avatar
Kunshan Wang committed
13 14 15
.typedef @thread    = threadref
.typedef @stack     = stackref
.typedef @tagref64  = tagref64
Kunshan Wang's avatar
Kunshan Wang committed
16

Kunshan Wang's avatar
Kunshan Wang committed
17 18 19 20 21 22 23 24 25 26 27
.typedef @4xi32     = vector <@i32 4>
.typedef @4xfloat   = vector <@float 4>
.typedef @2xdouble  = vector <@double 2>

// some abnormal vector sizes for trunc/ext tests and select tests
.typedef @4xi1      = vector <@i1 4>
.typedef @4xi16     = vector <@i16 4>
.typedef @4xi64     = vector <@i64 4>
.typedef @2xfloat   = vector <@float 2>
.typedef @4xdouble  = vector <@double 4>

Kunshan Wang's avatar
Kunshan Wang committed
28 29 30 31 32 33 34 35 36 37 38 39 40 41
.typedef @refi8     = ref<@i8>
.typedef @refi16    = ref<@i16>
.typedef @refi32    = ref<@i32>
.typedef @refi64    = ref<@i64>
.typedef @reffloat  = ref<@float>
.typedef @refdouble = ref<@double>

.typedef @irefi8    = iref<@i8>
.typedef @irefi16   = iref<@i16>
.typedef @irefi32   = iref<@i32>
.typedef @irefi64   = iref<@i64>
.typedef @ireffloat = iref<@float>
.typedef @irefdouble= iref<@double>

Kunshan Wang's avatar
Kunshan Wang committed
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
.typedef @weakrefi64    = weakref<@i64>

.typedef @refvoid       = ref<@void>
.typedef @irefvoid      = iref<@void>
.typedef @weakrefvoid   = weakref<@void>

.typedef @frv_v = funcref<@v_v>

.typedef @ptrvoid    = uptr<@void>
.typedef @ptri8      = uptr<@i8>
.typedef @ptri16     = uptr<@i16>
.typedef @ptri32     = uptr<@i32>
.typedef @ptri64     = uptr<@i64>
.typedef @ptrfloat   = uptr<@float>
.typedef @ptrdouble  = uptr<@double>
.typedef @ptrptrvoid = uptr<@ptrvoid>

.typedef @fpv_v     = ufuncptr<@v_v>
.typedef @fpi_i     = ufuncptr<@i_i>
.typedef @fpii_i    = ufuncptr<@ii_i>
Kunshan Wang's avatar
Kunshan Wang committed
62 63 64
.typedef @ptrfpv_v  = uptr<@fpv_v>
.typedef @ptrfpi_i  = uptr<@fpi_i>
.typedef @ptrfpii_i = uptr<@fpii_i>
Kunshan Wang's avatar
Kunshan Wang committed
65 66 67 68 69

.funcsig @v_v   = () -> ()

.funcsig @i_i   = (@i64) -> (@i64)
.funcsig @ii_i  = (@i64 @i64) -> (@i64)
70

Kunshan Wang's avatar
Kunshan Wang committed
71 72 73
.const @TRUE <@i64> = 1
.const @FALSE <@i64> = 0

Kunshan Wang's avatar
Kunshan Wang committed
74 75 76 77 78 79 80 81 82 83
.const @I32_0 <@i32> = 0
.const @I32_1 <@i32> = 1
.const @I32_2 <@i32> = 2
.const @I32_3 <@i32> = 3
.const @I32_4 <@i32> = 4
.const @I32_5 <@i32> = 5
.const @I32_6 <@i32> = 6
.const @I32_7 <@i32> = 7
.const @I32_8 <@i32> = 8
.const @I32_9 <@i32> = 9
Kunshan Wang's avatar
Kunshan Wang committed
84

Kunshan Wang's avatar
Kunshan Wang committed
85 86 87 88 89 90
.const @I32_10 <@i32> = 10
.const @I32_20 <@i32> = 20
.const @I32_30 <@i32> = 30
.const @I32_40 <@i32> = 40
.const @I32_50 <@i32> = 50
.const @I32_100 <@i32> = 100
91

Kunshan Wang's avatar
Kunshan Wang committed
92 93 94 95 96 97 98 99 100 101
.const @I64_0 <@i64> = 0
.const @I64_1 <@i64> = 1
.const @I64_2 <@i64> = 2
.const @I64_3 <@i64> = 3
.const @I64_4 <@i64> = 4
.const @I64_5 <@i64> = 5
.const @I64_6 <@i64> = 6
.const @I64_7 <@i64> = 7
.const @I64_8 <@i64> = 8
.const @I64_9 <@i64> = 9
Kunshan Wang's avatar
Kunshan Wang committed
102

103
.const @I64_10 <@i64> = 10
Kunshan Wang's avatar
Kunshan Wang committed
104 105 106
.const @I64_20 <@i64> = 20
.const @I64_30 <@i64> = 30
.const @I64_40 <@i64> = 40
107 108
.const @I64_50 <@i64> = 50
.const @I64_100 <@i64> = 100
Kunshan Wang's avatar
Kunshan Wang committed
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145

.const @F_0 <@float> = 0.0f
.const @F_1 <@float> = 1.0f
.const @F_2 <@float> = 2.0f
.const @F_3 <@float> = 3.0f
.const @F_4 <@float> = 4.0f
.const @F_5 <@float> = 5.0f
.const @F_6 <@float> = 6.0f
.const @F_7 <@float> = 7.0f
.const @F_8 <@float> = 8.0f
.const @F_9 <@float> = 9.0f

.const @F_10 <@float> = 10.0f
.const @F_20 <@float> = 20.0f
.const @F_30 <@float> = 30.0f
.const @F_40 <@float> = 40.0f
.const @F_50 <@float> = 50.0f
.const @F_100 <@float> = 100.0f
.const @F_NAN <@float> = nanf

.const @D_0 <@double> = 0.0d
.const @D_1 <@double> = 1.0d
.const @D_2 <@double> = 2.0d
.const @D_3 <@double> = 3.0d
.const @D_4 <@double> = 4.0d
.const @D_5 <@double> = 5.0d
.const @D_6 <@double> = 6.0d
.const @D_7 <@double> = 7.0d
.const @D_8 <@double> = 8.0d
.const @D_9 <@double> = 9.0d

.const @D_10 <@double> = 10.0d
.const @D_20 <@double> = 20.0d
.const @D_30 <@double> = 30.0d
.const @D_40 <@double> = 40.0d
.const @D_50 <@double> = 50.0d
.const @D_100 <@double> = 100.0d
146
.const @D_NAN <@double> = nand
Kunshan Wang's avatar
Kunshan Wang committed
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194

.const @4xI32_V1 <@4xi32> = {@I32_0 @I32_1 @I32_2 @I32_3}
.const @4xI32_V2 <@4xi32> = {@I32_4 @I32_5 @I32_6 @I32_7}
.const @4xI32_V3 <@4xi32> = {@I32_1 @I32_2 @I32_3 @I32_4}
.const @4xI32_V4 <@4xi32> = {@I32_10 @I32_20 @I32_30 @I32_40}
.const @4xI32_V5 <@4xi32> = {@I32_1 @I32_1 @I32_2 @I32_2}
.const @4xI32_V6 <@4xi32> = {@I32_1 @I32_2 @I32_1 @I32_2}

.const @4xF_V1 <@4xfloat> = {@F_0 @F_1 @F_2 @F_3}
.const @4xF_V2 <@4xfloat> = {@F_4 @F_5 @F_6 @F_7}
.const @4xF_V3 <@4xfloat> = {@F_1 @F_2 @F_3 @F_4}
.const @4xF_V4 <@4xfloat> = {@F_10 @F_20 @F_30 @F_40}
.const @4xF_V5 <@4xfloat> = {@F_1 @F_1 @F_2 @F_2}
.const @4xF_V6 <@4xfloat> = {@F_1 @F_2 @F_1 @F_2}
.const @4xF_V7 <@4xfloat> = {@F_NAN @F_NAN @F_NAN @F_NAN}

.const @2xD_V1 <@2xdouble> = {@D_0 @D_1}
.const @2xD_V2 <@2xdouble> = {@D_2 @D_3}
.const @2xD_V3 <@2xdouble> = {@D_1 @D_2}
.const @2xD_V4 <@2xdouble> = {@D_10 @D_20}
.const @2xD_V5 <@2xdouble> = {@D_1 @D_2}
.const @2xD_V6 <@2xdouble> = {@D_2 @D_2}
.const @2xD_V7 <@2xdouble> = {@D_NAN @D_NAN}

// some abnormal vectors
.const @I32_ABNORMAL0 <@i32> = 0x12345678
.const @I32_ABNORMAL1 <@i32> = 0x9abcdef0
.const @I32_ABNORMAL2 <@i32> = 0xfedcba98
.const @I32_ABNORMAL3 <@i32> = 0x76543210
.const @4xI32_ABNORMALV1 <@4xi32> = {@I32_ABNORMAL0 @I32_ABNORMAL1 @I32_ABNORMAL2 @I32_ABNORMAL3}

.const @F_1P5 <@float>  = 1.5f
.const @F_2P5 <@float>  = 2.5f
.const @4xF_ABNORMALV1 <@4xfloat> = {@F_1 @F_1P5 @F_2 @F_2P5}

.const @D_1P5 <@double> = 1.5d
.const @2xD_ABNORMALV1 <@2xdouble> = {@D_1 @D_1P5}

.const @NULLREF     <@refvoid>  = NULL
.const @NULLIREF    <@irefvoid> = NULL
.const @NULLFUNC    <@frv_v>    = NULL
.const @NULLSTACK   <@stack>    = NULL

.const @NULLREF_I64  <@refi64>  = NULL
.const @NULLIREF_I64 <@irefi64> = NULL

.const @PTRVOID_DUMMY1 <@ptrvoid> = 0xdeadbeef13572468
.const @FPI_I_DUMMY2   <@fpi_i>   = 0x55aa55aa5a5a5a5a