Click here to Skip to main content
15,349,126 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: From my crossassembler's manual Pin
CodeWraith5-Dec-20 23:21
MemberCodeWraith5-Dec-20 23:21 
GeneralRe: From my crossassembler's manual Pin
trønderen6-Dec-20 8:20
Membertrønderen6-Dec-20 8:20 
GeneralRe: From my crossassembler's manual Pin
CodeWraith6-Dec-20 14:39
MemberCodeWraith6-Dec-20 14:39 
GeneralRe: From my crossassembler's manual Pin
trønderen7-Dec-20 11:28
Membertrønderen7-Dec-20 11:28 
GeneralRe: From my crossassembler's manual Pin
CodeWraith7-Dec-20 13:03
MemberCodeWraith7-Dec-20 13:03 
GeneralRe: From my crossassembler's manual Pin
den2k886-Dec-20 6:05
professionalden2k886-Dec-20 6:05 
GeneralRe: From my crossassembler's manual Pin
trønderen6-Dec-20 8:36
Membertrønderen6-Dec-20 8:36 
GeneralRe: From my crossassembler's manual Pin
den2k886-Dec-20 11:18
professionalden2k886-Dec-20 11:18 
trønderen wrote:
And how much was the speedup of your application, running from start to end?

The application elaborated images in real time to eject damaged products from a live production line. The average elaboration window (aka the max time the software had to perform analysis and get to a decision) was 50ms, and we had about 26 algos running. Shearing a ms from an elaboration was priceless, as it was the average running time of many algos. The elaborations I optimized had to be performed 2-3 times per window, meaning 2-3 ms every 50.


trønderen wrote:
Another question of importance: Do you have an absolute guarantee that the assembly code and the C code implements exactly the same algorithm? If you let me have the assembly source code, so that I could in very simple C write exactly the same flow, do exactly the same tests etc. as in the assembly code, would the speed difference be the same?

Does the C compiler make use of the same hardware - here: The same set of instructions? If assembly code makes use of instructions that the compiler is not aware of, then you have a shortcoming of the compiler, not of HLL per se.

The algorithm is the same (not many ways you can rotate a 16bpp buffer of 90° degrees + eventual horizontal and or vertical mirrors), and the compiler does have access to the xmm registers.

Using assembler meant that I could develop my own algo that read contiguous strips of memory, maximizing cache usage, perform a rotation in register space and write the result in the required place in dest image. There is no way to do that in pure C.

In another instance I cut down the Sobel calculation of an image by a factor of 3, using the XMM registers as a contiguous memory space and building on the symmetrical and scale independent nature of the Sobel matrix. Using the mentioned Sobel calculation and injecting XMM using code to calculate integrals over 32 line blocks instead of doing it in C I brought an algo from 12ms on the worst case scenario to 4ms, which meant that it went from unusable to always enabled.


trønderen wrote:
If you won't talk about it: Note that I did, when writing:
(excluding those writing OS kernels and bottom level drivers).

Yup, I kind of forgot that programming microcontrollers is quite low level.
GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X

GeneralRe: From my crossassembler's manual Pin
Richard MacCutchan5-Dec-20 21:35
mveRichard MacCutchan5-Dec-20 21:35 
GeneralRe: From my crossassembler's manual Pin
CodeWraith5-Dec-20 23:29
MemberCodeWraith5-Dec-20 23:29 
GeneralRe: From my crossassembler's manual Pin
Richard MacCutchan6-Dec-20 1:25
mveRichard MacCutchan6-Dec-20 1:25 
GeneralRe: From my crossassembler's manual Pin
dandy726-Dec-20 3:24
Memberdandy726-Dec-20 3:24 
GeneralRe: From my crossassembler's manual Pin
CodeWraith6-Dec-20 3:54
MemberCodeWraith6-Dec-20 3:54 
GeneralRe: From my crossassembler's manual Pin
dandy727-Dec-20 9:24
Memberdandy727-Dec-20 9:24 
GeneralRe: From my crossassembler's manual Pin
den2k886-Dec-20 5:53
professionalden2k886-Dec-20 5:53 
JokeAin't it the truth Pin
Mike Hankey5-Dec-20 8:19
professionalMike Hankey5-Dec-20 8:19 
GeneralRe: Ain't it the truth Pin
OriginalGriff5-Dec-20 9:46
mveOriginalGriff5-Dec-20 9:46 
GeneralRe: Ain't it the truth Pin
Slacker0075-Dec-20 9:55
professionalSlacker0075-Dec-20 9:55 
GeneralRe: Ain't it the truth Pin
W Balboos, GHB6-Dec-20 1:11
mveW Balboos, GHB6-Dec-20 1:11 
GeneralRe: Ain't it the truth Pin
User 110609795-Dec-20 12:33
MemberUser 110609795-Dec-20 12:33 
QuestionAging in tech? Pin
honey the codewitch5-Dec-20 4:08
mvahoney the codewitch5-Dec-20 4:08 
AnswerRe: Aging in tech? Pin
Daniel Pfeffer5-Dec-20 5:18
professionalDaniel Pfeffer5-Dec-20 5:18 
GeneralRe: Aging in tech? Pin
W Balboos, GHB6-Dec-20 1:28
mveW Balboos, GHB6-Dec-20 1:28 
AnswerRe: Aging in tech? PinPopular
Roger Wright5-Dec-20 5:21
professionalRoger Wright5-Dec-20 5:21 
GeneralRe: Aging in tech? Pin
honey the codewitch5-Dec-20 5:25
mvahoney the codewitch5-Dec-20 5:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Straw Poll

What language are you using for AI development or learning?
Whether you're at work or home, hard core coding or just trying to figure out this AI thing, which languages have you used in your adventures?
  Results   89 votes