File: vectorcall-3.ispc

package info (click to toggle)
ispc 1.28.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 97,620 kB
  • sloc: cpp: 77,067; python: 8,303; yacc: 3,337; lex: 1,126; ansic: 631; sh: 475; makefile: 17
file content (23 lines) | stat: -rw-r--r-- 1,027 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// This test checks x86 instructions generated when vectorcall calling convention is not used on Windows.
// Without vectorcall, 'varying' arguments are not passed via vector registers.
// This results in a 'mov' instruction to move the data to vector registers in addition to the vector 'add'.
// RUN: %{ispc}  %s --emit-asm --no-vectorcall --target=avx2-i32x8 --target-os=windows -o - | FileCheck %s -check-prefix=CHECK_AVX2
// RUN: %{ispc}  %s --emit-asm --no-vectorcall --target=sse2-i32x4 --target-os=windows -o - | FileCheck %s -check-prefix=CHECK_SSE2
// RUN: %{ispc}  %s --emit-asm --no-vectorcall --target=sse4-i16x8 --target-os=windows -o - | FileCheck %s -check-prefix=CHECK_SSE4
// RUN: %{ispc}  %s --emit-asm --no-vectorcall --target=avx512skx-x16 --target-os=windows -o - | FileCheck %s -check-prefix=CHECK_AVX512

// REQUIRES: X86_ENABLED

// REQUIRES: WINDOWS_ENABLED

// CHECK_AVX2: mov

// CHECK_SSE2: mov

// CHECK_SSE4: mov

// CHECK_AVX512: mov

int addVal( int val1, int val2) {
    return val1 + val2;
}