147f7313dSRichard Henderson /*
247f7313dSRichard Henderson * TCG internals related to TCG temp allocation
347f7313dSRichard Henderson *
447f7313dSRichard Henderson * Copyright (c) 2008 Fabrice Bellard
547f7313dSRichard Henderson *
647f7313dSRichard Henderson * Permission is hereby granted, free of charge, to any person obtaining a copy
747f7313dSRichard Henderson * of this software and associated documentation files (the "Software"), to deal
847f7313dSRichard Henderson * in the Software without restriction, including without limitation the rights
947f7313dSRichard Henderson * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1047f7313dSRichard Henderson * copies of the Software, and to permit persons to whom the Software is
1147f7313dSRichard Henderson * furnished to do so, subject to the following conditions:
1247f7313dSRichard Henderson *
1347f7313dSRichard Henderson * The above copyright notice and this permission notice shall be included in
1447f7313dSRichard Henderson * all copies or substantial portions of the Software.
1547f7313dSRichard Henderson *
1647f7313dSRichard Henderson * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1747f7313dSRichard Henderson * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1847f7313dSRichard Henderson * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1947f7313dSRichard Henderson * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2047f7313dSRichard Henderson * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2147f7313dSRichard Henderson * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2247f7313dSRichard Henderson * THE SOFTWARE.
2347f7313dSRichard Henderson */
2447f7313dSRichard Henderson
2547f7313dSRichard Henderson #ifndef TCG_TEMP_INTERNAL_H
2647f7313dSRichard Henderson #define TCG_TEMP_INTERNAL_H
2747f7313dSRichard Henderson
2847f7313dSRichard Henderson /*
2947f7313dSRichard Henderson * Allocation and freeing of EBB temps is reserved to TCG internals
3047f7313dSRichard Henderson */
3147f7313dSRichard Henderson
3247f7313dSRichard Henderson void tcg_temp_free_internal(TCGTemp *);
3347f7313dSRichard Henderson
3458b79713SRichard Henderson void tcg_temp_free_i32(TCGv_i32 arg);
3558b79713SRichard Henderson void tcg_temp_free_i64(TCGv_i64 arg);
3658b79713SRichard Henderson void tcg_temp_free_i128(TCGv_i128 arg);
3758b79713SRichard Henderson void tcg_temp_free_ptr(TCGv_ptr arg);
3858b79713SRichard Henderson void tcg_temp_free_vec(TCGv_vec arg);
3947f7313dSRichard Henderson
404643f3e0SRichard Henderson TCGv_i32 tcg_temp_ebb_new_i32(void);
414643f3e0SRichard Henderson TCGv_i64 tcg_temp_ebb_new_i64(void);
424643f3e0SRichard Henderson TCGv_ptr tcg_temp_ebb_new_ptr(void);
434643f3e0SRichard Henderson TCGv_i128 tcg_temp_ebb_new_i128(void);
4447f7313dSRichard Henderson
45*04e006abSRichard Henderson /* Forget all freed EBB temps, so that new allocations produce new temps. */
tcg_temp_ebb_reset_freed(TCGContext * s)46*04e006abSRichard Henderson static inline void tcg_temp_ebb_reset_freed(TCGContext *s)
47*04e006abSRichard Henderson {
48*04e006abSRichard Henderson memset(s->free_temps, 0, sizeof(s->free_temps));
49*04e006abSRichard Henderson }
50*04e006abSRichard Henderson
5147f7313dSRichard Henderson #endif /* TCG_TEMP_FREE_H */
52