|
9 | 9 | ; operations are supported. Also verify that edge cases such as division |
10 | 10 | ; by zero are handled gracefully. |
11 | 11 |
|
| 12 | +; CHECK: @var_sconvert = addrspace(1) global i8 53 |
| 13 | +; CHECK: @var_uconvert = addrspace(1) global i8 53 |
12 | 14 | ; CHECK: @var_snegate = addrspace(1) global i32 -53 |
13 | 15 | ; CHECK: @var_not = addrspace(1) global i32 -54 |
14 | 16 | ; CHECK: @var_iadd = addrspace(1) global i32 49 |
|
43 | 45 | ; CHECK: @var_icmpsle = addrspace(1) global i1 false |
44 | 46 | ; CHECK: @var_icmpuge = addrspace(1) global i1 false |
45 | 47 | ; CHECK: @var_icmpsge = addrspace(1) global i1 true |
| 48 | +; CHECK: @var_bitcast = addrspace(1) global i32 1065353216 |
46 | 49 |
|
47 | 50 | OpCapability Addresses |
48 | 51 | OpCapability Linkage |
49 | 52 | OpCapability Kernel |
| 53 | + OpCapability Int8 |
50 | 54 | OpMemoryModel Physical32 OpenCL |
51 | 55 | OpEntryPoint Kernel %15 "foo" |
52 | 56 | OpName %entry "entry" |
| 57 | + OpDecorate %var_sconvert LinkageAttributes "var_sconvert" Export |
| 58 | + OpDecorate %var_uconvert LinkageAttributes "var_uconvert" Export |
53 | 59 | OpDecorate %var_snegate LinkageAttributes "var_snegate" Export |
54 | 60 | OpDecorate %var_not LinkageAttributes "var_not" Export |
55 | 61 | OpDecorate %var_iadd LinkageAttributes "var_iadd" Export |
|
83 | 89 | OpDecorate %var_icmpsle LinkageAttributes "var_icmpsle" Export |
84 | 90 | OpDecorate %var_icmpuge LinkageAttributes "var_icmpuge" Export |
85 | 91 | OpDecorate %var_icmpsge LinkageAttributes "var_icmpsge" Export |
| 92 | + OpDecorate %var_bitcast LinkageAttributes "var_bitcast" Export |
86 | 93 | %bool = OpTypeBool |
87 | 94 | %true = OpConstantTrue %bool |
88 | 95 | %false = OpConstantFalse %bool |
| 96 | + %uchar = OpTypeInt 8 0 |
89 | 97 | %uint = OpTypeInt 32 0 |
| 98 | + %float = OpTypeFloat 32 |
90 | 99 | %uint_0 = OpConstant %uint 0 |
91 | 100 | %uint_4 = OpConstant %uint 4 |
92 | 101 | %uint_53 = OpConstant %uint 53 |
93 | 102 | %uint_min4 = OpConstant %uint 0xfffffffc |
| 103 | + %float_1 = OpConstant %float 1.0 |
| 104 | + %sconvert = OpSpecConstantOp %uchar SConvert %uint_53 |
| 105 | + %uconvert = OpSpecConstantOp %uchar UConvert %uint_53 |
94 | 106 | %snegate = OpSpecConstantOp %uint SNegate %uint_53 |
95 | 107 | %not = OpSpecConstantOp %uint Not %uint_53 |
96 | 108 | %iadd = OpSpecConstantOp %uint IAdd %uint_53 %uint_min4 |
|
124 | 136 | %icmpsle = OpSpecConstantOp %bool SLessThanEqual %uint_53 %uint_min4 |
125 | 137 | %icmpuge = OpSpecConstantOp %bool UGreaterThanEqual %uint_53 %uint_min4 |
126 | 138 | %icmpsge = OpSpecConstantOp %bool SGreaterThanEqual %uint_53 %uint_min4 |
| 139 | + %bitcast = OpSpecConstantOp %uint Bitcast %float_1 |
| 140 | + %_ptr_uchar = OpTypePointer CrossWorkgroup %uchar |
127 | 141 | %_ptr_uint = OpTypePointer CrossWorkgroup %uint |
128 | 142 | %_ptr_bool = OpTypePointer CrossWorkgroup %bool |
129 | 143 | %void = OpTypeVoid |
130 | 144 | %14 = OpTypeFunction %void |
131 | 145 |
|
| 146 | +%var_sconvert = OpVariable %_ptr_uchar CrossWorkgroup %sconvert |
| 147 | +%var_uconvert = OpVariable %_ptr_uchar CrossWorkgroup %uconvert |
132 | 148 | %var_snegate = OpVariable %_ptr_uint CrossWorkgroup %snegate |
133 | 149 | %var_not = OpVariable %_ptr_uint CrossWorkgroup %not |
134 | 150 | %var_iadd = OpVariable %_ptr_uint CrossWorkgroup %iadd |
|
162 | 178 | %var_icmpsle = OpVariable %_ptr_bool CrossWorkgroup %icmpsle |
163 | 179 | %var_icmpuge = OpVariable %_ptr_bool CrossWorkgroup %icmpuge |
164 | 180 | %var_icmpsge = OpVariable %_ptr_bool CrossWorkgroup %icmpsge |
| 181 | +%var_bitcast = OpVariable %_ptr_uint CrossWorkgroup %bitcast |
165 | 182 |
|
166 | 183 | %15 = OpFunction %void Pure %14 |
167 | 184 | %entry = OpLabel |
|
0 commit comments