@@ -25,93 +25,93 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
2525
2626 let intrinsic_structure: Vec < _ > = intrinsic_name. split ( '_' ) . collect ( ) ;
2727
28- fn read_ord < ' tcx > ( ord : & str ) -> InterpResult < ' tcx , AtomicReadOrd > {
29- Ok ( match ord {
28+ fn read_ord ( ord : & str ) -> AtomicReadOrd {
29+ match ord {
3030 "seqcst" => AtomicReadOrd :: SeqCst ,
3131 "acquire" => AtomicReadOrd :: Acquire ,
3232 "relaxed" => AtomicReadOrd :: Relaxed ,
33- _ => throw_unsup_format ! ( "unsupported read ordering `{ord}`" ) ,
34- } )
33+ _ => panic ! ( "invalid read ordering `{ord}`" ) ,
34+ }
3535 }
3636
37- fn write_ord < ' tcx > ( ord : & str ) -> InterpResult < ' tcx , AtomicWriteOrd > {
38- Ok ( match ord {
37+ fn write_ord ( ord : & str ) -> AtomicWriteOrd {
38+ match ord {
3939 "seqcst" => AtomicWriteOrd :: SeqCst ,
4040 "release" => AtomicWriteOrd :: Release ,
4141 "relaxed" => AtomicWriteOrd :: Relaxed ,
42- _ => throw_unsup_format ! ( "unsupported write ordering `{ord}`" ) ,
43- } )
42+ _ => panic ! ( "invalid write ordering `{ord}`" ) ,
43+ }
4444 }
4545
46- fn rw_ord < ' tcx > ( ord : & str ) -> InterpResult < ' tcx , AtomicRwOrd > {
47- Ok ( match ord {
46+ fn rw_ord ( ord : & str ) -> AtomicRwOrd {
47+ match ord {
4848 "seqcst" => AtomicRwOrd :: SeqCst ,
4949 "acqrel" => AtomicRwOrd :: AcqRel ,
5050 "acquire" => AtomicRwOrd :: Acquire ,
5151 "release" => AtomicRwOrd :: Release ,
5252 "relaxed" => AtomicRwOrd :: Relaxed ,
53- _ => throw_unsup_format ! ( "unsupported read-write ordering `{ord}`" ) ,
54- } )
53+ _ => panic ! ( "invalid read-write ordering `{ord}`" ) ,
54+ }
5555 }
5656
57- fn fence_ord < ' tcx > ( ord : & str ) -> InterpResult < ' tcx , AtomicFenceOrd > {
58- Ok ( match ord {
57+ fn fence_ord ( ord : & str ) -> AtomicFenceOrd {
58+ match ord {
5959 "seqcst" => AtomicFenceOrd :: SeqCst ,
6060 "acqrel" => AtomicFenceOrd :: AcqRel ,
6161 "acquire" => AtomicFenceOrd :: Acquire ,
6262 "release" => AtomicFenceOrd :: Release ,
63- _ => throw_unsup_format ! ( "unsupported fence ordering `{ord}`" ) ,
64- } )
63+ _ => panic ! ( "invalid fence ordering `{ord}`" ) ,
64+ }
6565 }
6666
6767 match & * intrinsic_structure {
68- [ "load" , ord] => this. atomic_load ( args, dest, read_ord ( ord) ? ) ?,
69- [ "store" , ord] => this. atomic_store ( args, write_ord ( ord) ? ) ?,
68+ [ "load" , ord] => this. atomic_load ( args, dest, read_ord ( ord) ) ?,
69+ [ "store" , ord] => this. atomic_store ( args, write_ord ( ord) ) ?,
7070
71- [ "fence" , ord] => this. atomic_fence_intrinsic ( args, fence_ord ( ord) ? ) ?,
72- [ "singlethreadfence" , ord] => this. compiler_fence_intrinsic ( args, fence_ord ( ord) ? ) ?,
71+ [ "fence" , ord] => this. atomic_fence_intrinsic ( args, fence_ord ( ord) ) ?,
72+ [ "singlethreadfence" , ord] => this. compiler_fence_intrinsic ( args, fence_ord ( ord) ) ?,
7373
74- [ "xchg" , ord] => this. atomic_exchange ( args, dest, rw_ord ( ord) ? ) ?,
74+ [ "xchg" , ord] => this. atomic_exchange ( args, dest, rw_ord ( ord) ) ?,
7575 [ "cxchg" , ord1, ord2] =>
76- this. atomic_compare_exchange ( args, dest, rw_ord ( ord1) ? , read_ord ( ord2) ? ) ?,
76+ this. atomic_compare_exchange ( args, dest, rw_ord ( ord1) , read_ord ( ord2) ) ?,
7777 [ "cxchgweak" , ord1, ord2] =>
78- this. atomic_compare_exchange_weak ( args, dest, rw_ord ( ord1) ? , read_ord ( ord2) ? ) ?,
78+ this. atomic_compare_exchange_weak ( args, dest, rw_ord ( ord1) , read_ord ( ord2) ) ?,
7979
8080 [ "or" , ord] =>
81- this. atomic_rmw_op ( args, dest, AtomicOp :: MirOp ( BinOp :: BitOr , false ) , rw_ord ( ord) ? ) ?,
81+ this. atomic_rmw_op ( args, dest, AtomicOp :: MirOp ( BinOp :: BitOr , false ) , rw_ord ( ord) ) ?,
8282 [ "xor" , ord] =>
83- this. atomic_rmw_op ( args, dest, AtomicOp :: MirOp ( BinOp :: BitXor , false ) , rw_ord ( ord) ? ) ?,
83+ this. atomic_rmw_op ( args, dest, AtomicOp :: MirOp ( BinOp :: BitXor , false ) , rw_ord ( ord) ) ?,
8484 [ "and" , ord] =>
85- this. atomic_rmw_op ( args, dest, AtomicOp :: MirOp ( BinOp :: BitAnd , false ) , rw_ord ( ord) ? ) ?,
85+ this. atomic_rmw_op ( args, dest, AtomicOp :: MirOp ( BinOp :: BitAnd , false ) , rw_ord ( ord) ) ?,
8686 [ "nand" , ord] =>
87- this. atomic_rmw_op ( args, dest, AtomicOp :: MirOp ( BinOp :: BitAnd , true ) , rw_ord ( ord) ? ) ?,
87+ this. atomic_rmw_op ( args, dest, AtomicOp :: MirOp ( BinOp :: BitAnd , true ) , rw_ord ( ord) ) ?,
8888 [ "xadd" , ord] =>
89- this. atomic_rmw_op ( args, dest, AtomicOp :: MirOp ( BinOp :: Add , false ) , rw_ord ( ord) ? ) ?,
89+ this. atomic_rmw_op ( args, dest, AtomicOp :: MirOp ( BinOp :: Add , false ) , rw_ord ( ord) ) ?,
9090 [ "xsub" , ord] =>
91- this. atomic_rmw_op ( args, dest, AtomicOp :: MirOp ( BinOp :: Sub , false ) , rw_ord ( ord) ? ) ?,
91+ this. atomic_rmw_op ( args, dest, AtomicOp :: MirOp ( BinOp :: Sub , false ) , rw_ord ( ord) ) ?,
9292 [ "min" , ord] => {
9393 // Later we will use the type to indicate signed vs unsigned,
9494 // so make sure it matches the intrinsic name.
9595 assert ! ( matches!( args[ 1 ] . layout. ty. kind( ) , ty:: Int ( _) ) ) ;
96- this. atomic_rmw_op ( args, dest, AtomicOp :: Min , rw_ord ( ord) ? ) ?;
96+ this. atomic_rmw_op ( args, dest, AtomicOp :: Min , rw_ord ( ord) ) ?;
9797 }
9898 [ "umin" , ord] => {
9999 // Later we will use the type to indicate signed vs unsigned,
100100 // so make sure it matches the intrinsic name.
101101 assert ! ( matches!( args[ 1 ] . layout. ty. kind( ) , ty:: Uint ( _) ) ) ;
102- this. atomic_rmw_op ( args, dest, AtomicOp :: Min , rw_ord ( ord) ? ) ?;
102+ this. atomic_rmw_op ( args, dest, AtomicOp :: Min , rw_ord ( ord) ) ?;
103103 }
104104 [ "max" , ord] => {
105105 // Later we will use the type to indicate signed vs unsigned,
106106 // so make sure it matches the intrinsic name.
107107 assert ! ( matches!( args[ 1 ] . layout. ty. kind( ) , ty:: Int ( _) ) ) ;
108- this. atomic_rmw_op ( args, dest, AtomicOp :: Max , rw_ord ( ord) ? ) ?;
108+ this. atomic_rmw_op ( args, dest, AtomicOp :: Max , rw_ord ( ord) ) ?;
109109 }
110110 [ "umax" , ord] => {
111111 // Later we will use the type to indicate signed vs unsigned,
112112 // so make sure it matches the intrinsic name.
113113 assert ! ( matches!( args[ 1 ] . layout. ty. kind( ) , ty:: Uint ( _) ) ) ;
114- this. atomic_rmw_op ( args, dest, AtomicOp :: Max , rw_ord ( ord) ? ) ?;
114+ this. atomic_rmw_op ( args, dest, AtomicOp :: Max , rw_ord ( ord) ) ?;
115115 }
116116
117117 _ => return Ok ( EmulateItemResult :: NotSupported ) ,
0 commit comments