llvm.org GIT mirror llvm / 9a6eba6
PTX: Implement signed division git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141306 91177308-0d34-0410-b5e6-96231b3b80d8 Justin Holewinski 8 years ago
1 changed file(s) with 34 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
163163 def ri64 : InstPTX<(outs RegI64:$d),
164164 (ins RegI64:$a, i64imm:$b),
165165 !strconcat(opcstr, ".u64\t$d, $a, $b"),
166 [(set RegI64:$d, (opnode RegI64:$a, imm:$b))]>;
167 }
168
169 //===- Integer Instructions - 3 Operand Form (Signed) ---------------------===//
170 multiclass PTX_INT3_SIGNED {
171 def rr16 : InstPTX<(outs RegI16:$d),
172 (ins RegI16:$a, RegI16:$b),
173 !strconcat(opcstr, ".s16\t$d, $a, $b"),
174 [(set RegI16:$d, (opnode RegI16:$a, RegI16:$b))]>;
175 def ri16 : InstPTX<(outs RegI16:$d),
176 (ins RegI16:$a, i16imm:$b),
177 !strconcat(opcstr, ".s16\t$d, $a, $b"),
178 [(set RegI16:$d, (opnode RegI16:$a, imm:$b))]>;
179 def rr32 : InstPTX<(outs RegI32:$d),
180 (ins RegI32:$a, RegI32:$b),
181 !strconcat(opcstr, ".s32\t$d, $a, $b"),
182 [(set RegI32:$d, (opnode RegI32:$a, RegI32:$b))]>;
183 def ri32 : InstPTX<(outs RegI32:$d),
184 (ins RegI32:$a, i32imm:$b),
185 !strconcat(opcstr, ".s32\t$d, $a, $b"),
186 [(set RegI32:$d, (opnode RegI32:$a, imm:$b))]>;
187 def rr64 : InstPTX<(outs RegI64:$d),
188 (ins RegI64:$a, RegI64:$b),
189 !strconcat(opcstr, ".s64\t$d, $a, $b"),
190 [(set RegI64:$d, (opnode RegI64:$a, RegI64:$b))]>;
191 def ri64 : InstPTX<(outs RegI64:$d),
192 (ins RegI64:$a, i64imm:$b),
193 !strconcat(opcstr, ".s64\t$d, $a, $b"),
166194 [(set RegI64:$d, (opnode RegI64:$a, imm:$b))]>;
167195 }
168196
452480
453481 ///===- Integer Arithmetic Instructions -----------------------------------===//
454482
455 defm ADD : PTX_INT3<"add", add>;
456 defm SUB : PTX_INT3<"sub", sub>;
457 defm MUL : PTX_INT3<"mul.lo", mul>; // FIXME: Allow 32x32 -> 64 multiplies
458 defm DIV : PTX_INT3<"div", udiv>;
459 defm REM : PTX_INT3<"rem", urem>;
483 defm ADD : PTX_INT3<"add", add>;
484 defm SUB : PTX_INT3<"sub", sub>;
485 defm MUL : PTX_INT3<"mul.lo", mul>; // FIXME: Allow 32x32 -> 64 multiplies
486 defm DIV : PTX_INT3<"div", udiv>;
487 defm SDIV : PTX_INT3_SIGNED<"div", sdiv>;
488 defm REM : PTX_INT3<"rem", urem>;
460489
461490 ///===- Floating-Point Arithmetic Instructions ----------------------------===//
462491