Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » MSPGCC
  • » [Mspgcc-users] Why are interrupts disabled for hw multiplyintrinsics? [RSS Feed]

#1 March 14, 2008 18:28:33

N. C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Mspgcc-users] Why are interrupts disabled for hw multiplyintrinsics?


At 09:27 14-03-08 -0700, Norman Davis wrote:
>Hi everyone,
>
>For the following C language code:
>
>
> long a, b, c;
>
> b = 12345;
> c = 54321;
>
> a = b * c;
>
>I get the following assembler output in the .s file.
>
> mov #llo(12345), 4(r4)
> mov #lhi(12345), 4+2(r4)
> mov #llo(54321), 8(r4)
> mov #lhi(54321), 8+2(r4)
> mov 4(r4), r10
> mov 4+2(r4), r11
> mov 8(r4), r12
> mov 8+2(r4), r13
> push r2
> dint
> call #__umulsi3hw
> pop r2
> mov r14, @r4
> mov r15, 2(r4)
>
>It looks like the interrupts are being disabled around the call:
>
> push r2 ; store interrupt status (among other status)
> dint ; disable interrupts
> call #__umulsi3hw
> pop r2 ; restore previous interrupt status
>
>I'm curious what the purpose of this is. In my particular case, I know
>none of my interrupt routines (currently) use the hardware multiplier,
>so is there an option to disable this disabling? It might be adding a
>significant interrupt latency for my application.

Norman,
push r2 means saving register r2 onto the stack and pop r2 means restoring
it. This has nothing to do with interrupts. The contents of r2 needs to be
saved, that's all.

Nico Coesel


/---------------------------------------------------------------\
| N C T Developments |
|Innovative solutions for: |
| Electronics * Computers * Internet * Networking * Telecom |
\---------------------------------------------------------------/

Offline

#2 March 14, 2008 18:41:55

N. C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Mspgcc-users] Why are interrupts disabled for hw multiplyintrinsics?


At 18:26 14-03-08 +0100, you wrote:
>At 09:27 14-03-08 -0700, Norman Davis wrote:
>>Hi everyone,
>>
>>For the following C language code:
>>
>>
>> long a, b, c;
>>
>> b = 12345;
>> c = 54321;
>>
>> a = b * c;
>>
>>I get the following assembler output in the .s file.
>>
>> mov #llo(12345), 4(r4)
>> mov #lhi(12345), 4+2(r4)
>> mov #llo(54321), 8(r4)
>> mov #lhi(54321), 8+2(r4)
>> mov 4(r4), r10
>> mov 4+2(r4), r11
>> mov 8(r4), r12
>> mov 8+2(r4), r13
>> push r2
>> dint
>> call #__umulsi3hw
>> pop r2
>> mov r14, @r4
>> mov r15, 2(r4)
>>
>>It looks like the interrupts are being disabled around the call:
>>
>> push r2 ; store interrupt status (among other status)
>> dint ; disable interrupts
>> call #__umulsi3hw
>> pop r2 ; restore previous interrupt status
>>
>>I'm curious what the purpose of this is. In my particular case, I know
>>none of my interrupt routines (currently) use the hardware multiplier,
>>so is there an option to disable this disabling? It might be adding a
>>significant interrupt latency for my application.
>
>Norman,
>push r2 means saving register r2 onto the stack and pop r2 means restoring
>it. This has nothing to do with interrupts. The contents of r2 needs to be
>saved, that's all.

Skip this post. I'm typing complete nonsense...

Nico Coesel

Offline

  • Root
  • » MSPGCC
  • » [Mspgcc-users] Why are interrupts disabled for hw multiplyintrinsics? [RSS Feed]

Board footer

Moderator control

Enjoy the 16th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support