@@ -115,8 +115,8 @@ pub fn codegen_intrinsic_call(
115
115
let llval = match name {
116
116
_ if simple. is_some ( ) => {
117
117
bx. call ( simple. unwrap ( ) ,
118
- & args. iter ( ) . map ( |arg| arg. immediate ( ) ) . collect :: < Vec < _ > > ( ) ,
119
- None )
118
+ & args. iter ( ) . map ( |arg| arg. immediate ( ) ) . collect :: < Vec < _ > > ( ) ,
119
+ None )
120
120
}
121
121
"unreachable" => {
122
122
return ;
@@ -373,7 +373,6 @@ pub fn codegen_intrinsic_call(
373
373
return ;
374
374
}
375
375
}
376
-
377
376
} ,
378
377
"fadd_fast" | "fsub_fast" | "fmul_fast" | "fdiv_fast" | "frem_fast" => {
379
378
let sty = & arg_tys[ 0 ] . sty ;
@@ -822,8 +821,7 @@ fn codegen_msvc_try(
822
821
let i64p = Type :: i64 ( cx) . ptr_to ( ) ;
823
822
let ptr_align = bx. tcx ( ) . data_layout . pointer_align ;
824
823
let slot = bx. alloca ( i64p, "slot" , ptr_align) ;
825
- bx. invoke ( func, & [ data] , normal. llbb ( ) , catchswitch. llbb ( ) ,
826
- None ) ;
824
+ bx. invoke ( func, & [ data] , normal. llbb ( ) , catchswitch. llbb ( ) , None ) ;
827
825
828
826
normal. ret ( C_i32 ( cx, 0 ) ) ;
829
827
@@ -911,8 +909,7 @@ fn codegen_gnu_try(
911
909
// being thrown. The second value is a "selector" indicating which of
912
910
// the landing pad clauses the exception's type had been matched to.
913
911
// rust_try ignores the selector.
914
- let lpad_ty = Type :: struct_ ( cx, & [ Type :: i8p ( cx) , Type :: i32 ( cx) ] ,
915
- false ) ;
912
+ let lpad_ty = Type :: struct_ ( cx, & [ Type :: i8p ( cx) , Type :: i32 ( cx) ] , false ) ;
916
913
let vals = catch. landing_pad ( lpad_ty, bx. cx . eh_personality ( ) , 1 ) ;
917
914
catch. add_clause ( vals, C_null ( Type :: i8p ( cx) ) ) ;
918
915
let ptr = catch. extract_value ( vals, 0 ) ;
@@ -1000,11 +997,11 @@ fn generic_simd_intrinsic(
1000
997
( $msg: tt, $( $fmt: tt) * ) => {
1001
998
span_invalid_monomorphization_error(
1002
999
bx. sess( ) , span,
1003
- & format!( concat!( "invalid monomorphization of `{}` intrinsic: " ,
1004
- $msg) ,
1000
+ & format!( concat!( "invalid monomorphization of `{}` intrinsic: " , $msg) ,
1005
1001
name, $( $fmt) * ) ) ;
1006
1002
}
1007
1003
}
1004
+
1008
1005
macro_rules! return_error {
1009
1006
( $( $fmt: tt) * ) => {
1010
1007
{
@@ -1021,14 +1018,13 @@ fn generic_simd_intrinsic(
1021
1018
}
1022
1019
} ;
1023
1020
}
1021
+
1024
1022
macro_rules! require_simd {
1025
1023
( $ty: expr, $position: expr) => {
1026
1024
require!( $ty. is_simd( ) , "expected SIMD {} type, found non-SIMD `{}`" , $position, $ty)
1027
1025
}
1028
1026
}
1029
1027
1030
-
1031
-
1032
1028
let tcx = bx. tcx ( ) ;
1033
1029
let sig = tcx. normalize_erasing_late_bound_regions (
1034
1030
ty:: ParamEnv :: reveal_all ( ) ,
@@ -1121,17 +1117,17 @@ fn generic_simd_intrinsic(
1121
1117
} ;
1122
1118
1123
1119
return Ok ( bx. shuffle_vector ( args[ 0 ] . immediate ( ) ,
1124
- args[ 1 ] . immediate ( ) ,
1125
- C_vector ( & indices) ) )
1120
+ args[ 1 ] . immediate ( ) ,
1121
+ C_vector ( & indices) ) )
1126
1122
}
1127
1123
1128
1124
if name == "simd_insert" {
1129
1125
require ! ( in_elem == arg_tys[ 2 ] ,
1130
1126
"expected inserted type `{}` (element of input `{}`), found `{}`" ,
1131
1127
in_elem, in_ty, arg_tys[ 2 ] ) ;
1132
1128
return Ok ( bx. insert_element ( args[ 0 ] . immediate ( ) ,
1133
- args[ 2 ] . immediate ( ) ,
1134
- args[ 1 ] . immediate ( ) ) )
1129
+ args[ 2 ] . immediate ( ) ,
1130
+ args[ 1 ] . immediate ( ) ) )
1135
1131
}
1136
1132
if name == "simd_extract" {
1137
1133
require ! ( ret_ty == in_elem,
@@ -1150,9 +1146,7 @@ fn generic_simd_intrinsic(
1150
1146
) ;
1151
1147
match m_elem_ty. sty {
1152
1148
ty:: Int ( _) => { } ,
1153
- _ => {
1154
- return_error ! ( "mask element type is `{}`, expected `i_`" , m_elem_ty) ;
1155
- }
1149
+ _ => return_error ! ( "mask element type is `{}`, expected `i_`" , m_elem_ty)
1156
1150
}
1157
1151
// truncate the mask to a vector of i1s
1158
1152
let i1 = Type :: i1 ( bx. cx ) ;
@@ -1177,8 +1171,7 @@ fn generic_simd_intrinsic(
1177
1171
( $msg: tt, $( $fmt: tt) * ) => {
1178
1172
span_invalid_monomorphization_error(
1179
1173
bx. sess( ) , span,
1180
- & format!( concat!( "invalid monomorphization of `{}` intrinsic: " ,
1181
- $msg) ,
1174
+ & format!( concat!( "invalid monomorphization of `{}` intrinsic: " , $msg) ,
1182
1175
name, $( $fmt) * ) ) ;
1183
1176
}
1184
1177
}
@@ -1312,7 +1305,7 @@ fn generic_simd_intrinsic(
1312
1305
}
1313
1306
1314
1307
1315
- if name == "simd_gather" {
1308
+ if name == "simd_gather" {
1316
1309
// simd_gather(values: <N x T>, pointers: <N x *_ T>,
1317
1310
// mask: <N x i{M}>) -> <N x T>
1318
1311
// * N: number of elements in the input vectors
@@ -1360,7 +1353,7 @@ fn generic_simd_intrinsic(
1360
1353
// to the element type of the first argument
1361
1354
let ( pointer_count, underlying_ty) = match arg_tys[ 1 ] . simd_type ( tcx) . sty {
1362
1355
ty:: RawPtr ( p) if p. ty == in_elem => ( ptr_count ( arg_tys[ 1 ] . simd_type ( tcx) ) ,
1363
- non_ptr ( arg_tys[ 1 ] . simd_type ( tcx) ) ) ,
1356
+ non_ptr ( arg_tys[ 1 ] . simd_type ( tcx) ) ) ,
1364
1357
_ => {
1365
1358
require ! ( false , "expected element type `{}` of second argument `{}` \
1366
1359
to be a pointer to the element type `{}` of the first \
@@ -1414,7 +1407,7 @@ fn generic_simd_intrinsic(
1414
1407
return Ok ( v) ;
1415
1408
}
1416
1409
1417
- if name == "simd_scatter" {
1410
+ if name == "simd_scatter" {
1418
1411
// simd_scatter(values: <N x T>, pointers: <N x *mut T>,
1419
1412
// mask: <N x i{M}>) -> ()
1420
1413
// * N: number of elements in the input vectors
@@ -1570,7 +1563,6 @@ unsupported {} from `{}` with element `{}` of size `{}` to `{}`"#,
1570
1563
)
1571
1564
}
1572
1565
}
1573
-
1574
1566
} ;
1575
1567
Ok ( bx. $float_reduce( acc, args[ 0 ] . immediate( ) ) )
1576
1568
}
@@ -1750,9 +1742,9 @@ unsupported {} from `{}` with element `{}` of size `{}` to `{}`"#,
1750
1742
_ => { } ,
1751
1743
}
1752
1744
require!( false ,
1753
- "unsupported operation on `{}` with element `{}`" ,
1754
- in_ty,
1755
- in_elem)
1745
+ "unsupported operation on `{}` with element `{}`" ,
1746
+ in_ty,
1747
+ in_elem)
1756
1748
} ) *
1757
1749
}
1758
1750
}
0 commit comments