@@ -322,36 +322,26 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
322
322
} ,
323
323
}
324
324
} else {
325
- match new_kind {
326
- Int ( I128 ) | Uint ( U128 ) => {
327
- let func_name = match oop {
328
- OverflowOp :: Add => match new_kind {
329
- Int ( I128 ) => "__rust_i128_addo" ,
330
- Uint ( U128 ) => "__rust_u128_addo" ,
331
- _ => unreachable ! ( ) ,
332
- } ,
333
- OverflowOp :: Sub => match new_kind {
334
- Int ( I128 ) => "__rust_i128_subo" ,
335
- Uint ( U128 ) => "__rust_u128_subo" ,
336
- _ => unreachable ! ( ) ,
337
- } ,
338
- OverflowOp :: Mul => match new_kind {
339
- Int ( I128 ) => "__rust_i128_mulo" , // TODO(antoyo): use __muloti4d instead?
340
- Uint ( U128 ) => "__rust_u128_mulo" ,
341
- _ => unreachable ! ( ) ,
342
- } ,
343
- } ;
344
- return self . operation_with_overflow ( func_name, lhs, rhs) ;
345
- }
346
- _ => match oop {
347
- OverflowOp :: Mul => match new_kind {
348
- Int ( I32 ) => "__mulosi4" ,
349
- Int ( I64 ) => "__mulodi4" ,
350
- _ => unreachable ! ( ) ,
351
- } ,
352
- _ => unimplemented ! ( "overflow operation for {:?}" , new_kind) ,
325
+ let func_name = match oop {
326
+ OverflowOp :: Add => match new_kind {
327
+ Int ( I128 ) => "__rust_i128_addo" ,
328
+ Uint ( U128 ) => "__rust_u128_addo" ,
329
+ _ => unreachable ! ( ) ,
353
330
} ,
354
- }
331
+ OverflowOp :: Sub => match new_kind {
332
+ Int ( I128 ) => "__rust_i128_subo" ,
333
+ Uint ( U128 ) => "__rust_u128_subo" ,
334
+ _ => unreachable ! ( ) ,
335
+ } ,
336
+ OverflowOp :: Mul => match new_kind {
337
+ Int ( I32 ) => "__mulosi4" ,
338
+ Int ( I64 ) => "__mulodi4" ,
339
+ Int ( I128 ) => "__rust_i128_mulo" , // TODO(antoyo): use __muloti4d instead?
340
+ Uint ( U128 ) => "__rust_u128_mulo" ,
341
+ _ => unreachable ! ( ) ,
342
+ } ,
343
+ } ;
344
+ return self . operation_with_overflow ( func_name, lhs, rhs) ;
355
345
} ;
356
346
357
347
let intrinsic = self . context . get_builtin_function ( name) ;
@@ -364,6 +354,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
364
354
( res. dereference ( self . location ) . to_rvalue ( ) , overflow)
365
355
}
366
356
357
+ /// Non-`__builtin_*` overflow operations with a `fn(T, T, &mut i32) -> bool` signature.
367
358
pub fn operation_with_overflow (
368
359
& self ,
369
360
func_name : & str ,
0 commit comments