Commit 1f1e864
bpf: Handle sign-extenstin ctx member accesses
Currently, if user accesses a ctx member with signed types,
the compiler will generate an unsigned load followed by
necessary left and right shifts.
With the introduction of sign-extension load, compiler may
just emit a ldsx insn instead. Let us do a final movsx sign
extension to the final unsigned ctx load result to
satisfy original sign extension requirement.
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20230728011207.3712528-1-yonghong.song@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>1 parent 8100928 commit 1f1e864
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17716 | 17716 | | |
17717 | 17717 | | |
17718 | 17718 | | |
| 17719 | + | |
17719 | 17720 | | |
17720 | 17721 | | |
17721 | 17722 | | |
| |||
17797 | 17798 | | |
17798 | 17799 | | |
17799 | 17800 | | |
| 17801 | + | |
17800 | 17802 | | |
17801 | 17803 | | |
17802 | 17804 | | |
| |||
17856 | 17858 | | |
17857 | 17859 | | |
17858 | 17860 | | |
| 17861 | + | |
| 17862 | + | |
| 17863 | + | |
| 17864 | + | |
17859 | 17865 | | |
17860 | 17866 | | |
17861 | 17867 | | |
| |||
0 commit comments