Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import gcc-dg/vect directory from GCC #114

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

mablinov
Copy link

@mablinov mablinov commented Apr 8, 2024

Hi all.

This works builds directly off of our other MR waiting to be merged here, and simply adds the gcc-dg/vect subfolder.

Under x86_64 there are 2913 build targets, 1152 passing tests.

There is a minor "hack" right now in that the original vect.exp file from upstream uses lots of glob patterns to create the list of tests to run - I've re-created this behaviour here by instrumenting the GCC vect.exp to echo the globs, cat'ted them into a file, and then copied that into a new file created by this MR called SingleSource/Regression/C/gcc-dg/vect/DgVectTestList.txt. This file is then consumed in SingleSource/Regression/C/gcc-dg/vect/CMakeLists.txt to figure out what tests to run/not run.

common parts between C/gcc-c-torture/CMakeLists.txt and the new
C/gcc-dg/CMakeLists.txt are put in DgOptions.txt
The `pr89313.c` and `pr87600-1.c` tests were passing fine on LLVM
trunk (specifically I was on `c1eef483b2c1`), but failed on 17.0.5.

I bisected the failure down to the following LLVM commit:

d79ccee8dc4a [X86][MC] Support encoding/decoding for APX variant ADD/SUB/ADC/SBB/OR/XOR/NEG/NOT instructions (#76319)

So it turns out that the three-operand form of `add`, on x86_64, is
actually a very recent addition.

We should therefore probably avoid using it incase someone wants to
run against an older but still recent LLVM version.
RISC-V does not support the __bf16 datatype, therefore disable test.
GCC has the notion of "default test behaviour", which is stored in the
`dg-do-what-default` global variable. It specified what should happen
when there is no `dg-do` comment found in the test suite.

Our current behaviour is that if there's no `dg-do`, then we just
compile the test. But for the `gcc.c-torture/execute` directory, the
default behaviour is to run the test, because the `execute.exp` script
manaully sets it so:

```
set saved-dg-do-what-default ${dg-do-what-default}
set dg-do-what-default "run"
gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "" "-w"
set dg-do-what-default ${saved-dg-do-what-default}
```

We should probably model this behaviour in our CMake scripts, but for
now undo the refactoring in the execute/CMakeLists.txt script, and for
tests in that particular directory we always try to run the file.
In the GCC test suite many tests don't have an explicit `dg-do`
directive telling the test driver what to do. In these cases, the
default action is taken from a TCL variable called
`dg-do-what-default`, which can be set freely (see for example
gcc/testsuite/gcc.c-torture/execute/execute.exp)

Emulate this behaviour in our CMakeScripts also.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants