I have array of floats for output buffer and array of shorts for input. I need to add values from input buffer to values in output buffer. Using VFP unit the code looks as follows:
int temp[8]; while (numVectors--) { temp[0] = bin[0]; temp[1] = bin[1]; temp[2] = bin[2]; temp[3] = bin[3]; temp[4] = bin[4]; temp[5] = bin[5]; temp[6] = bin[6]; temp[7] = bin[7]; bin+=8; ASM ("fldmias %0, {s8-s15} \n\t" "fldmias %2, {s16-s23} \n\t" "fsitos s16,s16 \n\t" "fsitos s17,s17 \n\t" "fsitos s18,s18 \n\t" "fsitos s19,s19 \n\t" "fsitos s20,s20 \n\t" "fsitos s21,s21 \n\t" "fsitos s22,s22 \n\t" "fsitos s23,s23 \n\t" "fadds s8, s8, s16 \n\t" "fstmias %0!, {s8-s15} \n\t" : "=r" (bout) : "0" (bout), "r" (temp) : (long reg list was here); }
So shorts first converted to ints (pair of ldrsh/str operations), then loaded into VFP vector, converted to floats and added to existing values in output buffer eight-at-once. This works without problems and is fast.
Then I tried to preconvert shorts to floats and use array of floats as input to get rid of extra short->int->float conversion:
while (numVectors--) { ASM ("fldmias %0, {s8-s15} \n\t" "fldmias %1!, {s16-s23} \n\t" "fadds s8, s8, s16 \n\t" "fstmias %0!, {s8-s15} \n\t" : "=r" (bout), "=r" (fbin) : "0" (bout), "1" (fbin) : (long reg list was here); }
Imaging how was I surprised when measurements showed this code is actually much slower then previous. I’m not quite sure why but I think this is because array of floats takes twice more memory than array of shorts of the same length. It seems because of some caching access to large regions of memory is much slower than extra copy operations and VFP conversion together but accessing lesser memory range.
You should never "optimize" anything without doublechecking that things are really optimized, even if it looks obvious.
- Search
- Bookmarks
- Support for multiple Wikimapia languages
- New redesigned sleek UI
- Faster downloading because of direct access to DB
- New modern overlay visual style
- Better place details display - just text, no ads and so on
- Advanced settings
- UI translations: English, Russian, French, German
- Many more improvements and fixes
Boring. Stupid. Pointless.
Very nice graphics, though.
You know I’m going to add exporting to MIDI files in one of next versions. This will allow users to import SoundGrid Grids into any other DAW and each layer will become MIDI track. But this will not give you the same sound output without samples from soundbanks that were used in original Grid.
So I’m going to create SoundFont files matching all my soundbanks. Then you can assign appropriate SoundFonts to MIDI tracks (DAWs have either built-in support for SoundFonts or plugins) and hear the same sound. Unfortunately filters and effects can’t be exported/imported but I think this solution is still better than nothing.
- Title - name of your sound bank as it will be visible to users
- Author - your name, email and so on
- Descr - description, any text; currently not shown anywhere but will be in future
- ID - unique ID, any short text
- Type - type of audio samples, 'wav’ or 'if’, this corresponds to extension of audio files
- DefaultScale - ID of default scale if several scales defined below
- Scales - array of scales definitions. Five scales defined in example sound bank, you may remove some of them but one scale must always exist. Below is description of scale properties:
- ID - unique (for this sound bank) ID
- Name - name as it will be shown in scales list
- Descr - description, currently usually list of note names (will be deprecated in 2.1)
- Tones - space-separated list of names of corresponding audio files from lower to higher (without extension)
- MIDINotes - space-separated list of corresponding note names for upcoming exporting to MIDI feature. Examples of correct notes are: C2, F#3, Ab1 and so on (even D#-1). To skip note (eg. if there’s no sample provided) enter - (minus sign). This property isn’t actually required but will ensure correct mapping when exporting to MIDI.
- ServerName - name of your server, will be visible in server list
- SoundBanks - array of sound banks definitions, use provided definition of Waterdrillo sound bank as example, all properties have self-explanatory names (file sizes are in kilobytes). Don’t forget to change waterdrillo1 to ID of your sound bank.