X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftv%2Fstrcalc.h;h=cea758fa32fd89fe2888f706284edef41b49fc3c;hb=8010ed3d640a15ac18138d8a96ea61f318aae2cb;hp=0b740bb60364babca629e3ce95494b0755b2af24;hpb=1ce363f80e6a204d4011f85813362d9bd1d0e7e4;p=libfirm diff --git a/ir/tv/strcalc.h b/ir/tv/strcalc.h index 0b740bb60..cea758fa3 100644 --- a/ir/tv/strcalc.h +++ b/ir/tv/strcalc.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -23,7 +23,7 @@ * @date 2003 * @author Mathias Heil * @version $Id$ - * @summary + * @brief * * The module uses a string to represent values, and provides operations * to perform calculations with these values. @@ -107,6 +107,11 @@ void sc_neg(const void *value, void *buffer); */ void sc_and(const void *value1, const void *value2, void *buffer); +/** + * buffer = value1 & ~value2 + */ +void sc_andnot(const void *value1, const void *value2, void *buffer); + /** * buffer = value1 | value2 */ @@ -169,9 +174,9 @@ void sc_shr(const void *value1, const void *value2, int bitsize, int sign, void void sc_shrs(const void *value1, const void *value2, int bitsize, int sign, void *buffer); /** - * buffer = value1 <<>> value2 + * buffer = value1 <> value2 */ -void sc_rot(const void *value1, const void *value2, int bitsize, int sign, void *buffer); +void sc_rotl(const void *value1, const void *value2, int bitsize, int sign, void *buffer); /** * buffer = 0 @@ -186,8 +191,12 @@ int sc_get_buffer_length(void); void sign_extend(void *buffer, ir_mode *mode); -/** create an value form a string representation */ -void sc_val_from_str(const char *str, unsigned int len, void *buffer, ir_mode *mode); +/** + * create an value form a string representation + * @return 1 if ok, 0 in case of parse error + */ +int sc_val_from_str(char sign, unsigned base, const char *str, + size_t len, void *buffer); /** create a value from a long */ void sc_val_from_long(long l, void *buffer); @@ -212,7 +221,6 @@ int sc_get_highest_set_bit(const void *value); int sc_get_lowest_set_bit(const void *value); int sc_is_zero(const void *value); int sc_is_negative(const void *value); -int sc_had_carry(void); /** * Return the bits of a tarval at a given byte-offset. @@ -244,4 +252,13 @@ void init_strcalc(int precision_in_bytes); void finish_strcalc(void); int sc_get_precision(void); +/** Return the bit at a given position. */ +int sc_get_bit_at(const void *value, unsigned pos); + +/** Set the bit at the specified position. */ +void sc_set_bit_at(void *value, unsigned pos); + +/* Strange semantics */ +int sc_had_carry(void); + #endif /* FIRM_TV_STRCALC_H */