29
29
30
30
static inline void gen_log_predicated_reg_write (int rnum , TCGv val , int slot )
31
31
{
32
- TCGv zero = tcg_const_tl (0 );
32
+ TCGv zero = tcg_constant_tl (0 );
33
33
TCGv slot_mask = tcg_temp_new ();
34
34
35
35
tcg_gen_andi_tl (slot_mask , hex_slot_cancelled , 1 << slot );
@@ -47,7 +47,6 @@ static inline void gen_log_predicated_reg_write(int rnum, TCGv val, int slot)
47
47
tcg_gen_or_tl (hex_reg_written [rnum ], hex_reg_written [rnum ], slot_mask );
48
48
}
49
49
50
- tcg_temp_free (zero );
51
50
tcg_temp_free (slot_mask );
52
51
}
53
52
@@ -63,7 +62,7 @@ static inline void gen_log_reg_write(int rnum, TCGv val)
63
62
static void gen_log_predicated_reg_write_pair (int rnum , TCGv_i64 val , int slot )
64
63
{
65
64
TCGv val32 = tcg_temp_new ();
66
- TCGv zero = tcg_const_tl (0 );
65
+ TCGv zero = tcg_constant_tl (0 );
67
66
TCGv slot_mask = tcg_temp_new ();
68
67
69
68
tcg_gen_andi_tl (slot_mask , hex_slot_cancelled , 1 << slot );
@@ -92,7 +91,6 @@ static void gen_log_predicated_reg_write_pair(int rnum, TCGv_i64 val, int slot)
92
91
}
93
92
94
93
tcg_temp_free (val32 );
95
- tcg_temp_free (zero );
96
94
tcg_temp_free (slot_mask );
97
95
}
98
96
@@ -181,9 +179,8 @@ static inline void gen_read_ctrl_reg_pair(DisasContext *ctx, const int reg_num,
181
179
tcg_gen_concat_i32_i64 (dest , p3_0 , hex_gpr [reg_num + 1 ]);
182
180
tcg_temp_free (p3_0 );
183
181
} else if (reg_num == HEX_REG_PC - 1 ) {
184
- TCGv pc = tcg_const_tl (ctx -> base .pc_next );
182
+ TCGv pc = tcg_constant_tl (ctx -> base .pc_next );
185
183
tcg_gen_concat_i32_i64 (dest , hex_gpr [reg_num ], pc );
186
- tcg_temp_free (pc );
187
184
} else if (reg_num == HEX_REG_QEMU_PKT_CNT ) {
188
185
TCGv pkt_cnt = tcg_temp_new ();
189
186
TCGv insn_cnt = tcg_temp_new ();
@@ -331,15 +328,13 @@ static inline void gen_store_conditional4(DisasContext *ctx,
331
328
332
329
tcg_gen_brcond_tl (TCG_COND_NE , vaddr , hex_llsc_addr , fail );
333
330
334
- one = tcg_const_tl (0xff );
335
- zero = tcg_const_tl (0 );
331
+ one = tcg_constant_tl (0xff );
332
+ zero = tcg_constant_tl (0 );
336
333
tmp = tcg_temp_new ();
337
334
tcg_gen_atomic_cmpxchg_tl (tmp , hex_llsc_addr , hex_llsc_val , src ,
338
335
ctx -> mem_idx , MO_32 );
339
336
tcg_gen_movcond_tl (TCG_COND_EQ , pred , tmp , hex_llsc_val ,
340
337
one , zero );
341
- tcg_temp_free (one );
342
- tcg_temp_free (zero );
343
338
tcg_temp_free (tmp );
344
339
tcg_gen_br (done );
345
340
@@ -359,16 +354,14 @@ static inline void gen_store_conditional8(DisasContext *ctx,
359
354
360
355
tcg_gen_brcond_tl (TCG_COND_NE , vaddr , hex_llsc_addr , fail );
361
356
362
- one = tcg_const_i64 (0xff );
363
- zero = tcg_const_i64 (0 );
357
+ one = tcg_constant_i64 (0xff );
358
+ zero = tcg_constant_i64 (0 );
364
359
tmp = tcg_temp_new_i64 ();
365
360
tcg_gen_atomic_cmpxchg_i64 (tmp , hex_llsc_addr , hex_llsc_val_i64 , src ,
366
361
ctx -> mem_idx , MO_64 );
367
362
tcg_gen_movcond_i64 (TCG_COND_EQ , tmp , tmp , hex_llsc_val_i64 ,
368
363
one , zero );
369
364
tcg_gen_extrl_i64_i32 (pred , tmp );
370
- tcg_temp_free_i64 (one );
371
- tcg_temp_free_i64 (zero );
372
365
tcg_temp_free_i64 (tmp );
373
366
tcg_gen_br (done );
374
367
@@ -396,9 +389,8 @@ static inline void gen_store1(TCGv_env cpu_env, TCGv vaddr, TCGv src,
396
389
static inline void gen_store1i (TCGv_env cpu_env , TCGv vaddr , int32_t src ,
397
390
DisasContext * ctx , int slot )
398
391
{
399
- TCGv tmp = tcg_const_tl (src );
392
+ TCGv tmp = tcg_constant_tl (src );
400
393
gen_store1 (cpu_env , vaddr , tmp , ctx , slot );
401
- tcg_temp_free (tmp );
402
394
}
403
395
404
396
static inline void gen_store2 (TCGv_env cpu_env , TCGv vaddr , TCGv src ,
@@ -411,9 +403,8 @@ static inline void gen_store2(TCGv_env cpu_env, TCGv vaddr, TCGv src,
411
403
static inline void gen_store2i (TCGv_env cpu_env , TCGv vaddr , int32_t src ,
412
404
DisasContext * ctx , int slot )
413
405
{
414
- TCGv tmp = tcg_const_tl (src );
406
+ TCGv tmp = tcg_constant_tl (src );
415
407
gen_store2 (cpu_env , vaddr , tmp , ctx , slot );
416
- tcg_temp_free (tmp );
417
408
}
418
409
419
410
static inline void gen_store4 (TCGv_env cpu_env , TCGv vaddr , TCGv src ,
@@ -426,9 +417,8 @@ static inline void gen_store4(TCGv_env cpu_env, TCGv vaddr, TCGv src,
426
417
static inline void gen_store4i (TCGv_env cpu_env , TCGv vaddr , int32_t src ,
427
418
DisasContext * ctx , int slot )
428
419
{
429
- TCGv tmp = tcg_const_tl (src );
420
+ TCGv tmp = tcg_constant_tl (src );
430
421
gen_store4 (cpu_env , vaddr , tmp , ctx , slot );
431
- tcg_temp_free (tmp );
432
422
}
433
423
434
424
static inline void gen_store8 (TCGv_env cpu_env , TCGv vaddr , TCGv_i64 src ,
@@ -443,18 +433,15 @@ static inline void gen_store8(TCGv_env cpu_env, TCGv vaddr, TCGv_i64 src,
443
433
static inline void gen_store8i (TCGv_env cpu_env , TCGv vaddr , int64_t src ,
444
434
DisasContext * ctx , int slot )
445
435
{
446
- TCGv_i64 tmp = tcg_const_i64 (src );
436
+ TCGv_i64 tmp = tcg_constant_i64 (src );
447
437
gen_store8 (cpu_env , vaddr , tmp , ctx , slot );
448
- tcg_temp_free_i64 (tmp );
449
438
}
450
439
451
440
static TCGv gen_8bitsof (TCGv result , TCGv value )
452
441
{
453
- TCGv zero = tcg_const_tl (0 );
454
- TCGv ones = tcg_const_tl (0xff );
442
+ TCGv zero = tcg_constant_tl (0 );
443
+ TCGv ones = tcg_constant_tl (0xff );
455
444
tcg_gen_movcond_tl (TCG_COND_NE , result , value , zero , ones , zero );
456
- tcg_temp_free (zero );
457
- tcg_temp_free (ones );
458
445
459
446
return result ;
460
447
}
0 commit comments