@@ -7,10 +7,7 @@ use alloc::{
77use anyhow:: { Result , bail} ;
88use object:: { Endian as _, Object as _, ObjectSection as _, ObjectSymbol as _, elf} ;
99use rabbitizer:: {
10- IsaExtension , IsaVersion , Vram ,
11- abi:: Abi ,
12- operands:: { IU16 , ValuedOperand } ,
13- registers_meta:: Register ,
10+ IsaExtension , IsaVersion , Vram , abi:: Abi , operands:: ValuedOperand , registers_meta:: Register ,
1411} ;
1512
1613use crate :: {
@@ -335,14 +332,18 @@ fn push_args(
335332 }
336333
337334 match op {
338- ValuedOperand :: core_immediate ( imm) => {
335+ ValuedOperand :: core_imm_i16 ( imm) => {
339336 if let Some ( resolved) = relocation {
340337 push_reloc ( resolved. relocation , & mut arg_cb) ?;
341338 } else {
342- arg_cb ( match imm {
343- IU16 :: Integer ( s) => InstructionPart :: signed ( s) ,
344- IU16 :: Unsigned ( u) => InstructionPart :: unsigned ( u) ,
345- } ) ?;
339+ arg_cb ( InstructionPart :: signed ( imm) ) ?;
340+ }
341+ }
342+ ValuedOperand :: core_imm_u16( imm) => {
343+ if let Some ( resolved) = relocation {
344+ push_reloc ( resolved. relocation , & mut arg_cb) ?;
345+ } else {
346+ arg_cb ( InstructionPart :: unsigned ( imm) ) ?;
346347 }
347348 }
348349 ValuedOperand :: core_label( ..) | ValuedOperand :: core_branch_target_label( ..) => {
@@ -359,14 +360,13 @@ fn push_args(
359360 ) ) ?;
360361 }
361362 }
362- ValuedOperand :: core_immediate_base ( imm, base) => {
363+ ValuedOperand :: core_imm_rs ( imm, base) => {
363364 if let Some ( resolved) = relocation {
364365 push_reloc ( resolved. relocation , & mut arg_cb) ?;
365366 } else {
366- arg_cb ( InstructionPart :: Arg ( InstructionArg :: Value ( match imm {
367- IU16 :: Integer ( s) => InstructionArgValue :: Signed ( s as i64 ) ,
368- IU16 :: Unsigned ( u) => InstructionArgValue :: Unsigned ( u as u64 ) ,
369- } ) ) ) ?;
367+ arg_cb ( InstructionPart :: Arg ( InstructionArg :: Value (
368+ InstructionArgValue :: Signed ( imm as i64 ) ,
369+ ) ) ) ?;
370370 }
371371 arg_cb ( InstructionPart :: basic ( "(" ) ) ?;
372372 arg_cb ( InstructionPart :: opaque ( base. either_name (
0 commit comments