« first day (592 days earlier)      last day (2263 days later) » 

10:38 AM
How many instruction pipelines are there in modern processors?
 
10:54 AM
I think that depends on how you define instruction pipeline
 
2 messages moved from Lounge<C++>
 
11:10 AM
hello
What mean of blow command:
is total size of state0 16 byte?
or
it is 16 byte for every array element?

# define VAR_ALIGN(x, decl) __declspec(align(x)) decl
struct t1 {
VAR_ALIGN(16, uint8_t state0[200]);
}
 
11:31 AM
@ratchetfreak If there is a branch instruction ahead, the processor could build a pipeline for both the branches and wait. When the branch direction is evaluated, the correct pipeline is used and the other pipeline is flushed.
I was wondering if there could be lots of them depending on number of branches (including some in an existing pipeline). Main pipeline splits into two and if a branch is encountered in one of the subpipelines, the pipeline is again split into two.
 
@rahim it means the array is aligned to a 16-byte boundary
yesterday, by milleniumbug
(look up "alignment")
 
what mean of boundary?
@milleniumbug i see it but can not understand it
it not have example for above struct
ok
5
Q: What does alignment to 16-byte boundary mean in x86

SIMELIntel's official optimization guide has a chapter on converting from MMX commands to SSE where they state the fallowing statment: Computation instructions which use a memory operand that may not be aligned to a 16-byte boundary must be replaced with an unaligned 128-bit load (MOVDQU) followed...

 
7
Q: C# control the alignment of data

bossmanIn C++ you can use __declspec( align( # ) ) declarator to control the alignment of user-defined data. How can do this for C#. I have two procedures written on Assembler in my dll. Arguments for procedures (two arrays) should be aligned on 16 bytes. For C++ it works fine. I just used declarations...

 
11:53 AM
@Yashas I doubt you'll find a cpu with more than 2 per hyperthread
 
12:40 PM
I want to depict a one handed and a two handed gesture to object structure and connect them over inheritance coliru.stacked-crooked.com/a/4d829b5419b16147. Dont know, if a composition is maybe better.
 
 
2 hours later…
2:58 PM
if i have a int * a, and a function expecting a int k, if i do func(&a), will that pass a int? or will it still pass a int *
ok i ha a problem with passing a handleto a function, ill post a sample of my code
this is my code
i keep getting error in the function. Error 6, invalid handle
i dont understadn why, it must be that im passing it in the wrong way, dont i dont know why
does someone know what im doing wrong?
i used the setfilepointer in main and it works fine
if i put it in a func and pass it a handle it gives me error 6
 
3:24 PM
@jeyejow that will pass a int**
 
hmm
how do i pass a int then
 
from a int* variable? you use *a
 
ok, does that apply to a HANDLE object?
im having this weird error returned from SetFilePointer() when i use it inside a function
its says it is error 6, invalid handle
so i must be passing the handle wrong
ok i tried that and it gave me no error
i lost so much time after this, thanks alot man!
 
read up on how pointers and the address of semantics work
 
i will
i only knew how to pass an adress to a function using &
by knew i mean understood
 
3:38 PM
@jeyejow HANDLEs are always opaque references to kernel objects, just pass them by value and don't modify them. But usually I'd suggest an RAII wrapper (VS Provides one in <wrl.h>)
 
ive never heard of an RAII wrapper
does it have documentation? what is it for?
 
but if a pass the handle by value, wont that create annother handle?
 
handles are really just pointers (or no bigger than a pointer in the vast majority of cases)
 
3:42 PM
@jeyejow raw HANDLE are only duplicated if you call DuplicateHandle
@ratchetfreak literally defined as typedef void* HANDLE;
 
ohhh
well this RAII thing looks interesting
but i dont quite understand what it does
 
yeah the wrapper class I linked you wouldn't pass around, you'd still have most of your code take HANDLE
@jeyejow it calls CloseHandle or equivalent at the end of scope depending on what type of HANDLE you have
 
so its like a controller for a handle?
i dont need to worry about closing it?
or is there more to it?
 
so you can't leak HANDLEs like Intel twitter.com/BruceDawson0xB/status/965301833517289472
@jeyejow You can guarantee that the HANDLE will always close when you leave the scope in which you declare the wrapper
 
but how will that help me with passing handles to a function?
will that make the process easier?
im sorry im kinda slow understanding things in english
 
3:49 PM
@jeyejow different issues? You should in general always pass HANDLEs raw to a function that only uses and doesn't consume. The RAII stuff was just general advice.
 
without having them initialized?
but i cant have more then one pointer to a file
unless im doing syncrhonous reading or writting
witch im not
 
@jeyejow not following, HANDLEs are not pointers to memory per se from a userspace perspective.
you can't dereference them or use them other than to pass them to an OS function
 
yes i know, im using a OS function called SetFilePointer() wich lets me pointer to a position in the file or device that i have a handle for
but i cant have more then 1 pointer to my file, unless im doing a synchronous operation
am i saying something wrong?
cause i think im not
because when we make a handle i think there is a file to say if we are going to make ashyncorunous or synchronus operations
 
@jeyejow depends on how you open the file HANDLE
if you call CreateFile twice you have two different file pointers
 
im using the CreateFile
yes but you still need to say that you are making synchornous operations if you are going to have threads writting to the file in diferent positions for example
how to i resize a vector without losing the data in it?
for example if i alreaddy have 10 bytes in it occupied and i want to store 10 more without losing the previous data
how to i resize the vector to store 10 more without losing the previous?
 
4:01 PM
@jeyejow in that case you can either just push_back/emplace_back or resize it's not destructive unless you're holding a pointer to the data
or making it smaller
it'll just reallocate its buffer
 
oh ok
 

« first day (592 days earlier)      last day (2263 days later) »