#NEWLINE# @ lower_cast ( types . Integer , types . Integer ) #NEWLINE# def integer_to_integer( context , builder , fromty , toty , val ) : #NEWLINE# #INDENT# if ( toty . bitwidth == fromty . bitwidth ) : #NEWLINE# #INDENT# return val #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( toty . bitwidth < builder . bitwidth ) : #NEWLINE# #INDENT# return builder . trunc ( val , context . get_value_type ( toty ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if fromty . signed : #NEWLINE# #INDENT# return builder . sext ( val , context . get_value_type ( toty ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return builder . zext ( val , context . get_value_type ( toty ) )