@@ -696,9 +696,16 @@ mov_r_to_m(x86::Assembler &a, uint32 bytes_dst, uint32 kind_dst,
696696 * @return new stream
697697 */
698698static bool
699- mov_imm_to_m (x86::Assembler &a, x86::Mem &m_dst, Imm imm_src)
699+ mov_imm_to_m (x86::Assembler &a, x86::Mem &m_dst, Imm imm_src, uint32 bytes_dst )
700700{
701- a.mov (m_dst, imm_src);
701+ if (bytes_dst == 8 ) {
702+ /* As there is no instruction `MOV m64, imm64`, we use
703+ two instructions to implement it */
704+ a.mov (regs_i64[REG_I64_FREE_IDX], imm_src);
705+ a.mov (m_dst, regs_i64[REG_I64_FREE_IDX]);
706+ }
707+ else
708+ a.mov (m_dst, imm_src);
702709 return true ;
703710}
704711
@@ -931,7 +938,7 @@ st_imm_to_base_imm_offset_imm(x86::Assembler &a, uint32 bytes_dst,
931938 x86::Mem m ((uintptr_t )(base + offset), bytes_dst);
932939 Imm imm;
933940 imm_set_value (imm, data_src, bytes_dst);
934- return mov_imm_to_m (a, m, imm);
941+ return mov_imm_to_m (a, m, imm, bytes_dst );
935942}
936943
937944/* *
@@ -954,7 +961,7 @@ st_imm_to_base_imm_offset_r(x86::Assembler &a, uint32 bytes_dst, void *data_src,
954961 x86::Mem m (regs_i64[reg_no_offset], base, bytes_dst);
955962 Imm imm;
956963 imm_set_value (imm, data_src, bytes_dst);
957- return mov_imm_to_m (a, m, imm);
964+ return mov_imm_to_m (a, m, imm, bytes_dst );
958965}
959966
960967/* *
@@ -977,7 +984,7 @@ st_imm_to_base_r_offset_imm(x86::Assembler &a, uint32 bytes_dst, void *data_src,
977984 x86::Mem m (regs_i64[reg_no_base], offset, bytes_dst);
978985 Imm imm;
979986 imm_set_value (imm, data_src, bytes_dst);
980- return mov_imm_to_m (a, m, imm);
987+ return mov_imm_to_m (a, m, imm, bytes_dst );
981988}
982989
983990/* *
@@ -1001,7 +1008,7 @@ st_imm_to_base_r_offset_r(x86::Assembler &a, uint32 bytes_dst, void *data_src,
10011008 x86::Mem m (regs_i64[reg_no_base], regs_i64[reg_no_offset], 0 , 0 , bytes_dst);
10021009 Imm imm;
10031010 imm_set_value (imm, data_src, bytes_dst);
1004- return mov_imm_to_m (a, m, imm);
1011+ return mov_imm_to_m (a, m, imm, bytes_dst );
10051012}
10061013
10071014/* *
0 commit comments