google / google/xls

Multiplication of shorts is promoted to multiplication of ints

Open
#488 1 comment 0 reactions 0 assignees View on GitHub
enhancement xlscc
Dominant language
C++
Stars
1.9k
Forks
283
Avg merge
2d 10h
Merged PRs (30d)
135

Description

The initial XLS IR output from xlscc for multiplication of `short`s first does a sign_ext to promote both inputs to `int`s, then multiplies them, then returns the lower 16 bits of the result. This makes the optimizer work harder than is necessary, and some targets might not be able to optimize it away.

```
#pragma hls_top
short foo(short a, short b){
return a*b;
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.