File: 2720.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 (16 lines) | stat: -rw-r--r-- 603 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// The tests checks that no extra load/store instructions is generated.
// RUN: %{ispc} %s --arch=aarch64 --target=neon-i32x4 --emit-asm  -o - | FileCheck %s
// REQUIRES: ARM_ENABLED

// CHECK-COUNT: 1 mov
// CHECK-COUNT: 1 str
// CHECK-COUNT: 3 ldr
// CHECK-COUNT: 3 ldr
// CHECK-NOT: add
uniform int foo(uniform float v1[], uniform float v2[], uniform float v3[], uniform float result[]) {
    uniform float invArea = 1.f / ((v3[0] - v1[0]) * (v2[1] - v1[1]) - ((v3[1] - v1[1]) * (v2[0] - v1[0])));
    result[0] = invArea;
    result[1] = invArea;
    result[2] = invArea;
    result[3] = invArea;
}