> On May 2, 2017, at 6:57 AM, Amit kumar <[email protected]> wrote: > > Hi, > > Am trying to optimize an application using AVX/AVX2, but my code hangs while > trying to access YMM registers. > The instruction where my code hangs is : > > > vmovups ymm0, YMMWORD PTR [rax] > > > I have verified the cpuid in OS and it supports AVX and AVX2 instruction. > Processor i7 6th gen. > Can somebody help me out here ? Is there a way to enable YMM registers ? >
Amit, I think these instructions will generate an illegal instruction fault until you enable AVX. You need to check the Cpu ID bits in your code, then write BIT18 of CR4. After that XGETBV/XSETBV instructions are enabled and you can or in the lower 2 bits of XCR0. This basic operation is in the Intel Docs, it is just hard to find. Usually the OS has done this for the programmer and all the code needs to do is check the CPU ID. Thanks, Andrew Fish > > Thanks And Regards > Amit Kumar > > _______________________________________________ > edk2-devel mailing list > [email protected] > https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

