Jump to content
Sign in to follow this  
Steve_DeGroof

8-bit Shift Optimization Proposal #2

Recommended Posts

C Source:

  int intVal;

  intVal=intVall<<8;

 

Current output:

;;;;;;;; intVal=intVal<<8;

movf _intVal, W

movwf _code_tmp_0001

movf _intVal+1, W

movwf _code_tmp_0000

rlf _code_tmp_0001 , F

rlf _code_tmp_0000 , F

rlf _code_tmp_0001 , F

rlf _code_tmp_0000 , F

rlf _code_tmp_0001 , F

rlf _code_tmp_0000 , F

rlf _code_tmp_0001 , F

rlf _code_tmp_0000 , F

rlf _code_tmp_0001 , F

rlf _code_tmp_0000 , F

rlf _code_tmp_0001 , F

rlf _code_tmp_0000 , F

rlf _code_tmp_0001 , F

rlf _code_tmp_0000 , F

rlf _code_tmp_0001 , F

rlf _code_tmp_0000 , F

movf _code_tmp_0001 , W

andlw D'0'

clrf _code_tmp_0001

movwf _intVal

movf _code_tmp_0000 , W

movwf _intVal+D'1'

 

Proposed optimization:

movf _intVal, W

movwf _intVal+1

clrf _intVal

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×