@@ -2206,17 +2206,18 @@ defm INT_PTX_SATOM_XOR : ATOM2_bitwise_impl<"xor">;
22062206
22072207// atom.*.b128
22082208
2209- let mayLoad = 1, mayStore = 1, hasSideEffects = 1 in {
2209+ let mayLoad = true, mayStore = true, hasSideEffects = true,
2210+ Predicates = [hasAtomSwap128] in {
22102211 def ATOM_CAS_B128 :
22112212 NVPTXInst<
22122213 (outs B64:$dst0, B64:$dst1),
22132214 (ins ADDR:$addr, B64:$cmp0, B64:$cmp1, B64:$swap0, B64:$swap1,
22142215 AtomicCode:$sem, AtomicCode:$scope, AtomicCode:$addsp),
22152216 "{{\n\t"
2216- ".reg .b128 src1, src2 , dst;\n\t"
2217- "mov.b128 src1 , {$cmp0, $cmp1};\n\t"
2218- "mov.b128 src2 , {$swap0, $swap1};\n\t"
2219- "atom${sem:sem}${scope:scope}${addsp:addsp}.cas.b128 dst, $addr, src1, src2 ;\n\t"
2217+ ".reg .b128 cmp, swap , dst;\n\t"
2218+ "mov.b128 cmp , {$cmp0, $cmp1};\n\t"
2219+ "mov.b128 swap , {$swap0, $swap1};\n\t"
2220+ "atom${sem:sem}${scope:scope}${addsp:addsp}.cas.b128 dst, [ $addr], cmp, swap ;\n\t"
22202221 "mov.b128 {$dst0, $dst1}, dst;\n\t"
22212222 "}}">;
22222223
@@ -2226,9 +2227,9 @@ let mayLoad = 1, mayStore = 1, hasSideEffects = 1 in {
22262227 (ins ADDR:$addr, B64:$amt0, B64:$amt1,
22272228 AtomicCode:$sem, AtomicCode:$scope, AtomicCode:$addsp),
22282229 "{{\n\t"
2229- ".reg .b128 src1 , dst;\n\t"
2230- "mov.b128 src1 , {$amt0, $amt1};\n\t"
2231- "atom${sem:sem}${scope:scope}${addsp:addsp}.exch.b128 dst, $addr, src1 ;\n\t"
2230+ ".reg .b128 amt , dst;\n\t"
2231+ "mov.b128 amt , {$amt0, $amt1};\n\t"
2232+ "atom${sem:sem}${scope:scope}${addsp:addsp}.exch.b128 dst, [ $addr], amt ;\n\t"
22322233 "mov.b128 {$dst0, $dst1}, dst;\n\t"
22332234 "}}">;
22342235}
0 commit comments